Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support roles or permissions #11

Open
uocnb opened this issue Jan 24, 2015 · 1 comment
Open

Support roles or permissions #11

uocnb opened this issue Jan 24, 2015 · 1 comment

Comments

@uocnb
Copy link

uocnb commented Jan 24, 2015

I've just come to use this package and look like it only support filter for when(), this way it is needed to create many filters as permissions and roles for routes. I think it is better to support something like this:

Permissions
Trusty::when('users*', ['permissions' => ['manage_users']]);

Roles
Trusty::when('users*', ['roles' => ['administrator', 'manager']]);

Filter
Trusty::when('users*', ['filter' => ['manage_users']]);
or
Trusty::when('users*', 'manage_users');// Default

I was used Entrust and it can do like this:
Entrust::routeNeedsPermission('users*', 'manage_users')
Entrust::routeNeedsRole('users*', 'admin')

@gravitano
Copy link
Member

Thank for your suggestion. Maybe I would add this feature in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants