F
Filament10mo 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
RahulOP10mo ago
How to Fix this ??
Tieme
Tieme10mo ago
Use ->visible() Something like this
->visible(fn():bool => Auth()->user()->hasRole('administrator'))
->visible(fn():bool => Auth()->user()->hasRole('administrator'))
Want results from more Discord servers?
Add your server