F
Filamentβ€’9mo ago
SLy

Faded inactive action links based on Policy

Can I display default action links (View, Delete) as inactive, with a custom faded style if they are not authorized via policy? By default they are not displayed at all and I would like to keep the visual consistency for the Actions column.
Solution:
So add dummy action buttons? that are visible when the user has no rights
Jump to solution
5 Replies
toeknee
toekneeβ€’9mo ago
->disabled()
SLy
SLyβ€’9mo ago
Problem is the link does not show at all if the Policy does not authorize it. So if I have an DeleteAction but the Model Policy returns false because the model has some relations, the Delete button does not show at all and I would like to show the Delete button as disabled.
Solution
toeknee
toekneeβ€’9mo ago
So add dummy action buttons? that are visible when the user has no rights
SLy
SLyβ€’9mo ago
I thought might be some default filament way to do it, like some method/parameter that has this default behavior without adding dummy links. Will do that, thank you!
toeknee
toekneeβ€’9mo ago
Not that I am aware, we are quite strict on the permissions so things are not left around so keep it quite simple πŸ™‚
Want results from more Discord servers?
Add your server
More Posts