Mixing to handle common index route logic. Allows redirecting the user to a specified route, conditionally upon them having no roles. The purpose is to allow for an error page to display if the user has no permissions within the current app.
Usage: (in a routes file)
import Route from '@ember/routing/route';
import IndexMixin from '@bennerinformatics/ember-fw-gc/mixins/index-route';
export default Route.extend(IndexMixin, {
mainRoute: 'main'
// your code here
});
This should be incorporated into every app's route/index.js
. In practice, this means that the main page of your
app should be called something other than index
, so that index can be used properly for displaying the no
permissions page.