Ember Mixins for handling unauthorized access to application content
Ember-Unauthorized currently provides two mixins:
route-access. The former provides the base
implementation of this addon, with the latter providing route-specific code such as transitioning to an
The examples below will use the
route-access mixin, but you can customize your experience by using
or creating more mixins for different scenarios. We welcome contributions if you think you have a common use-case!
With Feature Flags
This addon has been optimized for use with Ember-Feature-Flags:
If you are using a customized key name to access your feature flags, import the mixin into your app and set
import RouteAccessMixin from 'my-app-name/mixins/route-access'; instead of taking it directly from the addon.
It is also easy to use other feature flag implementations. Simply override
Sometimes access to routes isn't solely determined by feature flags, such as through user role access control.
To address this, Ember-Unauthorized allows you to optionally implement an
authorize method that returns true if
the content is authorized for the user.
route-access mixin defines some default behavior for accessing unauthorized routes. When a user's authorization
fails, the mixin will automatically transition them to the
unauthorized route. If your application uses a different
route for this behavior, it can be customized via
Furthermore, if you do not want a transition to take place or need to add additional behavior, override the
This section outlines the details of collaborating on this Ember addon.
git clonethis repository
Running The Demo Application
- Visit your app at http://localhost:4200.
ember try:eachto test your addon against multiple Ember versions)
ember test --server
For more information on using ember-cli, visit https://ember-cli.com/.