Thanks for all tipps …
I could solve our problem.
@broerse Similar to the ember-simple-auth addon we had written our own session service that handle the authentication and tokens. Also we have a mixin “authenticated-route” that we need for needed authenticate routes.
@CezaryH My solution is embedded in our “authenticated-route” mixin. In first step the mixin check whether the session is authenticated by set token etc… For the permission check I implemented a “dynamic route permission check” based on the route-name. In beforeEach I get the agent with all permissions within a promise. here I check whether the agent have a permission like the route-name.
So we have a possibility to check all authenticated routes without specific implementation for each related route.
Finalized this feature is toggled by an environment configuration property so that a specific implementation is possible if needed.
An authenticated route “delivery-info” will check for permission “DELIVERYINFO”.
Is the check ok the chain will be called by