You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I have done is to make a 'fake' FilamentResource with custom permissions. In the canAccessPanel method in the User model you can check the permission. But bear in mind that you have to make a role just for one panel, so, for example, make a role 'Account Manager - Finance' and 'Account Manager - Order'.
class PanelResource extends Resource implements HasShieldPermissions
{
protectedstaticbool$shouldRegisterNavigation = false;
// Add here all the panels publicstaticfunctiongetPermissionPrefixes(): array
{
return [
'view_finance',
'view_order'
];
}
}
I was trying to use shield on a project where I have multiple panels with different guards (admin, web).
I could not use it on multiple panels and wanted to know if shield has the support for multiple panels.
The text was updated successfully, but these errors were encountered: