F
Filamentβ€’6mo ago
Archie

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β€’6mo ago
where you want to apply the Authorization?
Archie
Archieβ€’6mo 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β€’6mo 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β€’6mo ago
also by default all resources will read your policies and apply it
Archie
Archieβ€’6mo 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β€’6mo ago
yes also there is plugin make easier like #shield
Archie
Archieβ€’6mo ago
Ok, many thanks