Pete Posted June 16, 2014 Share Posted June 16, 2014 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. 7 Link to comment Share on other sites More sharing options...
Pete Posted June 16, 2014 Author Share Posted June 16, 2014 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! 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