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.
5 Replies
->disabled()
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
So add dummy action buttons? that are visible when the user has no rights
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!
Not that I am aware, we are quite strict on the permissions so things are not left around so keep it quite simple π