- Issue created by @Liam Morland
- Status changed to Postponed: needs info
11 months ago 7:39pm 5 January 2024 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Wondering what the use case is, generally speaking we should be checking permissions not roles
- Status changed to Active
11 months ago 8:10pm 5 January 2024 - π¨π¦Canada Liam Morland Ontario, CA π¨π¦
The tickets that reference this one would probably use such a function.
In my case, I wanted to customize which roles
auto_username
module acts on. The problem with using permissions is that the administrator role always has all of them. If I made a permission which would cause users to be excluded fromauto_username
, the administrator role would be excluded even if I don't want it to be. - π¬π§United Kingdom longwave UK
It feels like your permission is inverted. Permissions should grant access to something rather than revoke it.
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
A permission could grant a user the ability to avoid having
auto_username
change their username. But perhaps we actually want administrators to have auto-generated usernames. So we make the permission mean that they have access toauto_username
generating their username. Now we can't choose that administrators customize their own names.The function I'm asking for is useful in the context of having methods like
::hasRole()
and::getRoles()
. On the same basis it could be argued that those methods should not exist because everything should be done with permissions.