custom page access
How can i set a gate/access for a custom page? I only want people with a specific role to be able to visit that page
11 Replies
I think via
mount
method? It's a standard LW componenthow would you do that
I want it to also be removed from the navigation
@RobinDev For navigation you can use shouldRegisterNavigation() and return an bool.
or create a policy
Filament
Getting started - Pages - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
Policies are not meant for pages
I use filament shield and then on custom page add "use HasPageShield;"
and on role select specific role to access to custom page
Just starting... π
But then i think i'm using it in the wrong way bc if in UserPolicy, for example, I return the function update() false then you don't have access to update the model but then you can't access the /edit page either.
Or am I abusing this?
But your edit page is part of a resource? It works with resources but not with custom pages
Right! Ah, question misunderstood! Thanks!
What if the custom page is inside the resource? hasPageShield is not working. I am using Filament-shield. I want to restrict users for accessing the custom page inside the ex. EmployeeResource folder
Hi, did you get a solution for this? I'm facing a similar challenge