F
Filament7mo ago
Vitor

Panels with some identical resources

Hello, I have a application with 3 different panels (admin, factory and storekeeper). Basically: Admin panel can access with the guard user and role admin; Factory panel can acess with guard factory; Storekeeper panel can acess with guard shop; The admin can access all the resources; The factory can access just products and sales resources, and there must be logic to search only for products related to the factory logged in. Storekeeper mantain the factory logic, acessing just the sales and products related to the storekeeper logged in. What would be the correct way to block these resources depending on the panel? Is there any way to have a variable in the resource (like $factoryCanAcess: bool), and inside each panel in discoverResources i check for the variable?
4 Replies
Dennis Koch
Dennis Koch7mo ago
Do you really need separate Panels then? Maybe Policies would just work fine?
Vitor
VitorOP7mo ago
The separate panels not "including" the unnecessary resources is safer than policies, or not?
Dennis Koch
Dennis Koch7mo ago
Depends on how you like to structure your app. But probably easier
Vitor
VitorOP7mo ago
Filament shield is a good option?
Want results from more Discord servers?
Add your server