phpsa / filament-authentication

MIT License
106 stars 23 forks source link

Question: should permissions be deletable? #21

Closed tiagof closed 1 year ago

tiagof commented 1 year ago

Hi, this is kinda of a conceptual question: Currently permissions can be delete (Via the relationship table in the Roles' edit page). Should be allowed?

The point is that when checking if a user has a particular permission, an exception is thrown if that permission does not exist. So deleting permissions is not really recommended

In addition, when considering roles, maybe they should not be deletable if assigned to at least 1 role... ?

Thanks.

ps: Happy to provide PRs to tackle this if it makes sense.

phpsa commented 1 year ago

Hi,

Does make sence, I did originally build this in as 2 of my projects using this had to tackle roles differently, Happy for you to look further into it. -- that said - how I generally deal with it in my projects would be the same as I do anywhere else - making use of a Policy to return whether or not we are allowed.

tiagof commented 1 year ago

Hi,

you're right. There's really nothing to tackle. Just used policies and it is solved (still getting used to how filament manages all this).

Thanks !