Jump to content

Recommended Posts

Posted

I would like a user to login to the admin and only see certain pages. I cannot figure this out or if it's possible. I've hunted through the forums and nothing seems to be able to do this.

I have a list of pages like this:

Home>
Page 1 >
Page 2 >

I would like User 1 to login and only see:

Home> 
Page 1 >

And User 2 to login and only see:

Home>
Page 2 >

 

 

Posted

I usually hide some pages because the user has no business snooping around them.

Put in ready.php:

if(!$this->user->hasRole('superuser')){

  /* hide pages on their ID:
  1026  FormBuilder
  1000  Search
  */
  $wire->addHookAfter('Page(id=1026|1000)::listable', function($event) {
    $event->return = false;
  });
}

You have ro refine the condition fo the user though...

In case you have more users or have to do this dynamically you are better off with permissions or a module to do this.

  • Like 2

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
  • Recently Browsing   0 members

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