Filament Shield: 1 Same Model in 2 Filament Resource

I have two resources that use the same model. When I assign a role that should only grant access to Resource 1, it doesn’t show up on the User’s dashboard. However, if I enable access to both Resource 1 and Resource 2 in the role settings for User, both resources appear in the dashboard, which is not expected because I only want Resource 1 to be visible in User Dashboard and both resource in Admin Dashboard. How do I show only Resource 1 to User Dashboard?
1 Reply
Pritbor
Pritbor3w ago
Sheild has a way to have custom permissions for each resource. So maybe you can create permissions with slghtly different names for each resource and then select accordingly. Further in your Model policy file develope the conditional logic accordingly. https://filamentphp.com/plugins/bezhansalleh-shield#custom-permissions
Filament
Shield by Bezhan Salleh - Filament
The easiest and most intuitive way to add access management to your Filament Panel's Resources, Pages & Widgets through spatie/laravel-permission.
Want results from more Discord servers?
Add your server