Jump to content

[Solved] Hide the "Pages" tab in the admin, for non-superusers missing specific permission


Federico
 Share

Recommended Posts

Hello,

I'm sure it requires a simple hook to hide the entire Pages tab in admin (for non-superusers), but none of the post in this forum nor the hooks directory seem providing an answer as far as I know.

5aad5d5d0a5ba_ScreenShot2018-03-17at7_23_58PM.png.c56ba5789020d49ef2253add8e430b06.png

looking for adding the hook in ready.php, like this example

$wire->addHookAfter('Page::listable', function(HookEvent $event) { // BUT I AM LOOKING TO HOOK THE ENTIRE TAB CALLED PAGES, NOT JUST THE LIST INSIDE
    $page = $event->object; 
    $user = $this->user;  
    if($this->wire('user')->hasPermission('example')) {
       $event->return = false;
    }
});

someone more experienced?

thanks a lot

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...