adrianmak Posted January 28, 2015 Posted January 28, 2015 There is a user role which is used for content editing. In my local testing, contact form submission result will be stored as page and use admin process to display the result. Since the admin process all bind to a admin template, if I give rights to a user role, all other admin page will be view by that role. And this is not I wanted to. How to give access rights for a admin process, in my case, is the form submission result Editor role access pages only I want the Editor role able to access the form result 1
adrian Posted January 28, 2015 Posted January 28, 2015 This module works perfectly for exactly that scenario: http://modules.processwire.com/modules/admin-restrict-page-tree/ PS Not exactly an earth shattering 3000th post (how time flies when you're having fun), but hopefully helpful anyway 5
Jan Romero Posted January 28, 2015 Posted January 28, 2015 If you have created your own ProcessModule for this, you can add the “permission” property to its module info. Only users with the set permission will load the module. The admin page will be hidden for everyone else. You can also set up your module so that it creates the permission on installation, and automatically removes it when it is uninstalled. 5
adrianmak Posted January 28, 2015 Author Posted January 28, 2015 If you have created your own ProcessModule for this, you can add the “permission” property to its module info. Only users with the set permission will load the module. The admin page will be hidden for everyone else. You can also set up your module so that it creates the permission on installation, and automatically removes it when it is uninstalled. Ya.....just two lines of code and done public static function getModuleInfo() { return array( 'title' => 'Process Module (basic example)', 'summary' => 'A very simple process module as an example on how easy they are to create.', 'version' => 100, 'href' => '', 'permission' => 'form-submit-view', /* permission required */ 'permissions' => array( 'form-submit-view' => 'Form submission result.' ) /* install new permission */ ); }
adrian Posted January 28, 2015 Posted January 28, 2015 Ya.....just two lines of code and done Don't you still want to hide the main page tree and redirect them to them to your Form Result Process Module, or did I misunderstand? Anyway, that is what the module from netcarver, wanze, and kongondo will do - of course you still need to assign the permission to view the page like Jan showed. Actually, re-reading your first post now, maybe you didn't want to hide everything else at all - maybe my 3000th post wasn't helpful at all - oh well, can't win them all 1
Soma Posted January 28, 2015 Posted January 28, 2015 It's not about winning here Congrats Adrian anyway.
modifiedcontent Posted December 31, 2017 Posted December 31, 2017 Is this all still valid? Setting permission in the ProcessModule for the custom admin seems to be the cleanest way to make that admin available to a specific role. But yes, how do you then hide the main page tree for that role? My custom admin will be an alternative to the main page tree edit interface. Is AdminRestrictPageTree still the (only) way to achieve that? That module is still alpha, getting kinda old, not explicitly compatible with 3.0 Here is another thread about the same issue; how to hide the tree when there is a custom admin for a specific role. That thread fizzled out in 2015. If you want to create an admin that looks completely different from the standard admin, is it a better approach to use a custom myadmin template?
dragan Posted January 1, 2018 Posted January 1, 2018 There's also this module: I just installed it on a 3.0.86 site - it works as advertised 1
alexm Posted June 12, 2018 Posted June 12, 2018 I can't seem to get this setup working. I have added permissions to a Process module which lives under Admin and added the permission to the role 'admin'. But the module page is still not visible in the top navigation. Any thoughts? Thanks in advance.
dragan Posted June 12, 2018 Posted June 12, 2018 Did you clear the module cache? Maybe also logout / login again.
alexm Posted June 14, 2018 Posted June 14, 2018 Apologies for slow response @dragan I cleared the assets/cache directory and logged out and in but user with role admin cannot see the process page. The role admin has the required permission assigned to it.
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