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

Add or remove roles dynamically #3

Open
Emanuel-23 opened this issue Aug 11, 2020 · 1 comment
Open

Add or remove roles dynamically #3

Emanuel-23 opened this issue Aug 11, 2020 · 1 comment

Comments

@Emanuel-23
Copy link
Contributor

Emanuel-23 commented Aug 11, 2020

Would be great to add or remove roles dynamically.

So basically the idea is to

  • add a role from the defined config, if it does not exists (already possible).
  • remove a role if it is not defined in the config (AND it is not a default role !!!)

I'd suggest not to remove default rules.

@kellymears What do you think? Should not be too hard to implement :)

Edit: Might be confusing, though. If we had a whitelist of roles, that should not be removed at all, this might be difficult or impossible to maintain when it comes to custom roles, added by plugins. Maybe its a godd idea to introduce another config array, that defines all roles that could be removed dynamically. Like this:

    'removable' => [
        'mycustomRole',
        'myothercustomerrole'
    ],

or alternatively by defining it in the existing roles array like this:

    'mycustomRole' => [
        'removable' => true,
    ],
    'myothercustomerrole' => [
        'removable' => true,
    ],
@kellymears
Copy link
Member

If I have some time in the next week or so I want to revisit this package. I like this idea.

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