How to check if a group has a permission or set of permissions assigned #800
Unanswered
sammyskills
asked this question in
Q&A
Replies: 1 comment 1 reply
-
In role-based access control, a role (group in Shield) has permissions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @team,
Let's say we have this type of group/permission structure:
And a navigation menu like this:
users.view
permission)users.create
permission)payments.view
permission)payments.add
permission)To display the appropriate link to the currently logged in user, we can do something like this:
So when an
admin
user logs in, s/he is expected to see this navigation:And when an
auditor
user logs in, s/he is expected to see this navigation:This looks okay and simple to implement, but an issue arises when there are a lot of permissions to check, for example:
Are we expected to run multiple OR conditions like this?
Beta Was this translation helpful? Give feedback.
All reactions