-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 ability to deactivate a role (Enable/Disable) #4821
Add ability to deactivate a role (Enable/Disable) #4821
Conversation
Seems travis failure originated from schema not related to my pull. |
@georgesjamous you added a new field to the schema so the test need to be updated |
@georgesjamous thanks for the PR, but as I mentioned before, the roles availability should be managed by their ACL’s. |
@dplewis oh alright, my mistake! @flovilmart yes, I am still trying to figure out a way for the role to follow the ACL. But, I thought this could be a useful addition. |
This is in the Auth module, the query for the role should also include the visibility for the current user / role being inferred, as with ACL’s. |
I looked at the One solution I thought of is to fetch all the roles normally (like it is done right now), The method would be to compile a list (tree-like) of direct roles (where the user is part of) A simple example for the simplest cases (i have also checked more complex ones): This is the best solution I could think of that doesn't require additional requests and is not costly. If you have thought of a better way or think for some reason that this not a good solution, let me know. |
Let’s try it out, that seems reasonable as the full role tree is pulled. Let’s see what it looks like with the tests etc... what do you think? |
Its worth a shot, will let you guys know the results |
Great thanks! |
Sorry for the delay, haven't been able to find the time for it yet. |
This PR addresses the open proposal #4591 to add a functionality to Enable/Disable a role.
Disabling a role will prevent the role from granting permissions to its users or any of its children roles.
I think this functionality can come in handy when it is needed to temporarily disable a role tree.
Another other solution could be as discussed in #4591 is to set the role ACL to masterKey,
preventing access to the role, but:
This is my first PR, hope I did well :)