Is there a way to hide the whole navigation panel depending on role?
One role in a system i am building is supposed to have access only to a single page so, they would like the whole nav panel not to show as it makes no sense. Is there a way to accomplish this?
7 Replies
Try #bezhansalleh-shield
And you assign
user
to particular page (role/permission) and when that user login they should only see those permissions (single page)thanks but that only hides those pages from the navigation. And you end up with a panel that's empty. I am trying to hide the whole nav panel.
check like
->navigation(fn(): bool => auth()->user()->can_see_navigation)
Thank you! would be great if this worked but it gives an error:
Call to a member function getNavigation() on false
π->navigation(false)
does work but would disable for everyonecan you check like this for specific user?
w8
https://github.com/filamentphp/filament/blob/3.x/packages/panels/src/Panel/Concerns/HasNavigation.php#L27
By looking the source code, it should accept closure tho.. not sure why it's not working
Yup, I'm wondering the same question, you have, SuperAdmin, Admin, "Manager", "Crew"... Super and Admin should be able to see and manage roles and permissions, but the rest shouldn't, they shouldn't even be able to see it, you can hide them but they still able to manage it if they have the URL... I haven't seen any official solution for that.