Authorizable actions #1826
jacksleight
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
Can you not just use the |
Beta Was this translation helpful? Give feedback.
4 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be great if Filament could authorize actions in the same way it already authorises the main model methods when a policy exists. I've implemented this in a very basic way using a custom
ButtonAction
class:Then you just call
requiresAuthorization()
on the button andisHidden()
will check whether it's authorized. Becausecall()
also checksisHidden()
executing the action is also blocked (although a 403 response would probably be better there).I was going to submit a PR but I'm sure my solution here isn't ideal, and there are probably various ways this could be implemented.
Beta Was this translation helpful? Give feedback.
All reactions