Jump to content

Separate Page Tree Permission


Pete
 Share

Recommended Posts

There's a permission for viewing a page and a permission for editing a page. Assigning the page edit permission to a role means they see the Pages page in the admin.

There are situations where I don't want them to be able to see that (custom intranets). It would be nice if it was possible to have a separate permission to decide whether or not to show that page.

There is a way to code around it in the admin template and only show it for roles that I specify, but it would be nice if there was a way to do it with permissions.

  • Like 7
Link to comment
Share on other sites

There was a way to hide the two menus that popped up for non-superuser folks. In sidenav.inc in the admin template module, just at the start of the function I added this:

if ($p->name == 'page' && !wire('user')->hasRole('superuser') || $p->name == 'setup' && !wire('user')->hasRole('superuser')) {
    return '';
}

For some reason, doing isSuperuser() didn't work in this case. If it works for someone else using wire('user')->isSuperuser() then it may be because of some overridden permissions in one of my modules I guess.

It's a fairly easy workaround, but not particularly futureproof!

  • Like 1
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...