Ivan Gretsky Posted October 7, 2015 Share Posted October 7, 2015 Good day! I need to make custom admin interface for specific user role. I want them to only see those menus and menu items I selected. I do not want them to see "Pages". I plan to use custom Process modules under custom admin menu. But I do want to use PageEdit admin interface for editing pages. To make it possible, I have to set edit permission to the pages they are to edit. But that uncovers "Pages" menu for them. How can I achieve that, still using defaul or Reno admin theme? Or is it preferable to make my own? Link to comment Share on other sites More sharing options...
Martijn Geerts Posted October 7, 2015 Share Posted October 7, 2015 You could build upon https://github.com/Da-Fecto/CustomHomeRedirect. You could select a page in the configurable interface to redirect to. There's no support for that module however. 2 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted October 7, 2015 Author Share Posted October 7, 2015 Thanks. Your module does redirect the user where it is needed. Bit I still have the "Pages" menu visible. How can I get rid of it? Link to comment Share on other sites More sharing options...
Martijn Geerts Posted October 7, 2015 Share Posted October 7, 2015 (edited) Place something alike in your init and user with role 'your-role' won't see Pages $this->addHookAfter('Page::viewable', function($event) { // 3 is the ID of Pages if ($event->object->id === 3 && $this->user->hasRole('your-role')) { $event->return = false; } }); ps, code is not tested... Edited October 7, 2015 by Martijn Geerts typo fix in code 5 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