F
Filamentβ€’13mo 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β€’13mo ago
->disabled()
SLy
SLyOPβ€’13mo 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β€’13mo ago
So add dummy action buttons? that are visible when the user has no rights
SLy
SLyOPβ€’13mo 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β€’13mo 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