Roope Posted March 9, 2014 Share Posted March 9, 2014 I have three roles for admin users (admin, sales, billing) and all of them have custom admin process page under /admin/. I'd like to limit page view permisions so that 'sales' couldn't see custom admin page for role 'billing'. This could be done easily by using diogos Admin Custom Pages Module but it's not compatible with new admin theme and has some another disadvantages compared to straight Process Module approach. Is there any way to control $page->viewable() per role even if pages share the same template? Thanks for any help! Link to comment Share on other sites More sharing options...
kongondo Posted March 9, 2014 Share Posted March 9, 2014 Roope, Would this help? - "Page Edit Per Role" module by pogidude. There's a couple of similar modules there, FYI. Link to comment Share on other sites More sharing options...
Roope Posted March 9, 2014 Author Share Posted March 9, 2014 I was playing with Ryans Page Edit Per User but totally missed this one.. Thanks kongondo! Actually this wasn't even needed since now that custom admin pages are process modules, I can create permission for each and use that with role to limit access. Works very nice. Link to comment Share on other sites More sharing options...
kongondo Posted March 9, 2014 Share Posted March 9, 2014 ...Actually this wasn't even needed since now that custom admin pages are process modules, I can create permission for each and use that with role to limit access. Works very nice. That was my thinking too but wasn't sure what your use case was...Glad you sorted it out.. Link to comment Share on other sites More sharing options...
Roope Posted March 11, 2014 Author Share Posted March 11, 2014 (edited) Yep, my explanations in finnish are usually terrible and worse at english so it can be hard in both ends Then to another problem with this case. There is 'item' template with no access settings but noticed that when I log in as non superuser it throws me error when creating new page. User can still edit existing page with no problems. Just updated core from dev to 2.4.1 but no change. Permissions for sales role at item page (parent has same): page-view page-edit page-delete page-move page-create page-add Error: TemplateFile: You don't have access to the template required to add pages here #0 [internal function]: ProcessPageAdd->___execute() #1 /Users/Roope/Sites/demo/wire/core/Wire.php(359): call_user_func_array(Array, Array) #2 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('execute', Array) #3 /Users/Roope/Sites/demo/wire/core/ProcessController.php(196): Wire->__call('execute', Array) #4 /Users/Roope/Sites/demo/wire/core/ProcessController.php(196): ProcessPageAdd->execute() #5 [internal function]: ProcessController->___execute() #6 /Users/Roope/Sites/demo/wire/core/Wire.php(359): call_user_func_array(Array, Array) #7 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('execute', Array) #8 /Users/Roope/Sites/demo/wire/core/admin.php(64): Wire->__call('execute', Array) #9 /Users/Roope/Sites/demo/wire/core/admin.php(64): ProcessController->execute() #10 /Users/Roope/Sites/demo/wire/modules/AdminTheme/AdminThemeDefault/controller.php(13): require('/Users/Roope/Si...') #11 /Users/Roope/Sites/demo/site/templates/admin.php(24): require('/Users/Roope/Si...') #12 /Users/Roope/Sites/demo/wire/core/TemplateFile.php(140): require('/Users/Roope/Si...') #13 [internal function]: TemplateFile->___render() #14 /Users/Roope/Sites/demo/wire/core/Wire.php(359): call_user_func_array(Array, Array) #15 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('render', Array) #16 /Users/Roope/Sites/demo/wire/modules/PageRender.module(337): Wire->__call('render', Array) #17 /Users/Roope/Sites/demo/wire/modules/PageRender.module(337): TemplateFile->render() #18 [internal function]: PageRender->___renderPage(Object(HookEvent)) #19 /Users/Roope/Sites/demo/wire/core/Wire.php(359): call_user_func_array(Array, Array) #20 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('renderPage', Array) #21 /Users/Roope/Sites/demo/wire/core/Wire.php(381): Wire->__call('renderPage', Array) #22 /Users/Roope/Sites/demo/wire/core/Wire.php(381): PageRender->renderPage(Object(HookEvent)) #23 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('render', Array) #24 /Users/Roope/Sites/demo/wire/modules/Process/ProcessPageView.module(152): Wire->__call('render', Array) #25 /Users/Roope/Sites/demo/wire/modules/Process/ProcessPageView.module(152): Page->render() #26 [internal function]: ProcessPageView->___execute() #27 /Users/Roope/Sites/demo/wire/core/Wire.php(359): call_user_func_array(Array, Array) #28 /Users/Roope/Sites/demo/wire/core/Wire.php(317): Wire->runHooks('execute', Array) #29 /Users/Roope/Sites/demo/index.php(194): Wire->__call('execute', Array) #30 /Users/Roope/Sites/demo/index.php(194): ProcessPageView->execute() #31 {main} EDIT: I can fix this if I set page permissions manually but when set 'No' only superuser is able to add new 'item' pages. Edited March 11, 2014 by Roope 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