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

Feature request: Rights handling based on roles #68

Open
sonntagd opened this issue Dec 28, 2016 · 1 comment
Open

Feature request: Rights handling based on roles #68

sonntagd opened this issue Dec 28, 2016 · 1 comment

Comments

@sonntagd
Copy link
Contributor

sonntagd commented Dec 28, 2016

I need a possibility to define rights based on roles. The roles I get are ActiveDirectory groups the user is a member of (e.g. "developers", "support", "operations"). When restricting a route, e.g. "create_item", I do not want to list the roles that are allowed to do this, but the right the user has to have. This right could be called "create_item" or more general "item_management", depending on the granularity needed.

Now I want to define a mapping in the config file that says:

    create_item: developers, operations

which means that you can create an item if you are in the developers or in the operations group. One could extend this to be able to define that a right needs all roles listed.

So if a new role comes into play, I do not have to change the code but only the config.

We should add new keywords like require_right and so on.

Is this something others would also need? I could try to provide a pull request.

@sonntagd sonntagd changed the title rights handling based on roles Feature request: Rights handling based on roles Dec 28, 2016
@sonntagd
Copy link
Contributor Author

I created a small plugin that uses Auth::Extensible and implements the above functionality:
Dancer2::Plugin::Auth::Extensible::Rights
It is not yet on CPAN.

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

1 participant