F
Filament11mo ago
Rahul

Custom Action Buttons Policy Conflict

use Filament\Pages\Actions\Action; I have created a custom 'Edit' action button in the table action section of the resource, and also created a custom 'Create' action button on the list page. Due to this setup, my policy is not working as intended. This means that within the 'viewAny' permission, it includes both editing existing records and creating new ones
2 Replies
Rahul
RahulOP11mo ago
How to Fix this ??
Tieme
Tieme11mo ago
Use ->visible() Something like this
->visible(fn():bool => Auth()->user()->hasRole('administrator'))
->visible(fn():bool => Auth()->user()->hasRole('administrator'))

Did you find this page helpful?