shogun Posted May 17, 2020 Share Posted May 17, 2020 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 > Link to comment Share on other sites More sharing options...
Klenkes Posted May 17, 2020 Share Posted May 17, 2020 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. 2 Link to comment Share on other sites More sharing options...
psy Posted May 17, 2020 Share Posted May 17, 2020 @shogun This module may help or provide a good starting point: https://modules.processwire.com/modules/admin-restrict-page-tree/ Link to comment Share on other sites More sharing options...
shogun Posted May 17, 2020 Author Share Posted May 17, 2020 5 minutes ago, psy said: @shogun This module may help or provide a good starting point: https://modules.processwire.com/modules/admin-restrict-page-tree/ I don't want to hide the entire tree. I want to restrict a user to view and edit only a specific tree like this: User 2: So they can only see/edit the page 2 tree below for example and not page 1 Home > Page 1> Page 2 > Link to comment Share on other sites More sharing options...
shogun Posted May 17, 2020 Author Share Posted May 17, 2020 I think the module I found below does the job. The main limitation is that it only allows you choose one Branch to restrict a user to. That works for me now, but ideally it should allow you to choose multiple branches to restrict a user to. http://modules.processwire.com/modules/admin-restrict-branch/ 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now