hasPermission function #460
sourcecanada
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
this is a good idea 👍 |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So still learning myth-auth, but from a designer perspective I did run into a snag out the gate.
When designing templates you might have a section of the page that should only display if the user has access to at least one of the items inside the section, otherwise there is no point in displaying it.
Based on what I could find a slight modification was needed to the function "hasPermission" to use $permission as an array which then changes the function to allow either a single permission request or an array of requests.
I've included the code below showing the modified hasPermissions function in the FlatAuthorization.php file. Is there a better way to accomplish this goal? I'd like to know if i'm missing something.
Beta Was this translation helpful? Give feedback.
All reactions