-
Notifications
You must be signed in to change notification settings - Fork 51
Use via RouterDSL #56
Copy link
Copy link
Open
Description
Hi there, we found ourselves writing the following code in routes, which is great. However, as the app grew we felt like we could all benefit from a birds eye view of all the routes that require abilities.
beforeModel: function() {
if (!this.can('write post')) {
this.transitionTo('index');
}
}
We thought the best place for overlooking those would be in the Router.map.
Router.map(function() {
this.route('posts', { abilities: ['manage team', 'view post'] }, function() {
this.route('create', { abilities: ['create post'] });
this.route('show', { path: ':id', resourceAbilities: ['update post'] });
});
});
We've implemented an extension of the RouterDSL in a similar manner to the way ember-torii does with authenticatedRoute.
I was wondering if you would be interested in including this type of functionality into this addon.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels