Convenience route that bundles some of the restricted route mixins. It extends the basic functionality of the AuthRoute, except it adds to it one more factor: it allows you to filter which roles have access to this page. It also allows you to specify a rejectedRoute to transition to when the user does not have the proper roles. This is used most commonly within the apps for the admin pages (which are restricted to admin and global-admin) roles. For more information see the RestrictedRouteMixin.

Usage: (in a routes file)

import RestrictedRoute from './restricted';

export default RestrictedRoute.extend({
    // your code here...
});
Show:

Methods

Properties

permit
(
  • roles
  • goTo
)
Ember.Transition | Null
public

Checks a role or list of roles against a user's available roles. If the check fails, the app will transition to the route specified.

Parameters:

  • roles String | Array

    Roles to check

  • goTo String

    Route to transition to if the check fails

Returns:

Ember.Transition | Null

rejectedRoute

String public

Route to transition to if the roles check fails. This may have more use case to override than in AuthRoute.


Default: index

roles

Array public

Array of roles to be passed to the match function