F
Filamentβ€’12mo ago
Robin

Spatie roles and permissions

Is it possible to use @can....@endcan in filament?
Solution:
yes also there is plugin make easier like #shield
Jump to solution
8 Replies
Lara Zeus
Lara Zeusβ€’12mo ago
where you want to apply the Authorization?
Robin
RobinOPβ€’12mo ago
Normally I would just add them to the PermissionSeeder class and put @ can.. @endcan on the blade files. Buttons and pages mostly. But if there's a better way to do it in filament I'm ready to check it out πŸ˜„
Lara Zeus
Lara Zeusβ€’12mo ago
ya again depend on your use case... πŸ™‚ for filament pages and respurces yo can use canVewAny for actions you can set ->visible(... has role...) and so on.. each package has its part on authorization
Lara Zeus
Lara Zeusβ€’12mo ago
also by default all resources will read your policies and apply it
Robin
RobinOPβ€’12mo ago
Ok ty I'll check it out. But finally, is it possible to give it to something like a role and assign then to users?
Solution
Lara Zeus
Lara Zeusβ€’12mo ago
yes also there is plugin make easier like #shield
Robin
RobinOPβ€’12mo ago
Ok, many thanks
Want results from more Discord servers?
Add your server