LostKobrakai Posted January 4, 2016 Share Posted January 4, 2016 I'm currently missing a quite useful feature in the module. I've the following setup to prevent unnecessary verbosity, where client accounts are defined like so: role=client, company=SomeCompany (page field). This way I just need to define each company in a single place as well as handle the client role permissions and access rules once. Now I've a list of projects, where clients should only be able to see those projects, where the company field does hold their assigned company. This is certainly possible with dynamic roles right now, but it's introducing the verbosity that I tried to avoid, meaning I need to have at least a single drole per client. I'd much rather use a single drole to handle all clients and assign them view access like so: template=project, client=user.client. From looking into the code I think this would mostly be another "where" check for mysql queries and the runtime permission checks should be even more simple to implement. @renobird I'm not sure if you still need it, but dynamic roles do not work on admin pages (process modules). See this for a working solution: https://processwire.com/talk/topic/6822-module-dynamic-roles-for-pw-246/page-3#entry98415 1 Link to comment Share on other sites More sharing options...
matjazp Posted November 3, 2016 Share Posted November 3, 2016 Hi! I'm using DynamicRoles on PW 3.0.33 and I get errors: As superuser: PagesLoader: Class 'DynamicRole' for Pages::getById() does not exist As "dynamicroles" user : Error: Exception: Method Page::hasEditPermission does not exist or is not callable in this context (in C:\inetpub\wwwroot\wire\core\Wire.php line 410) #0 C:\inetpub\wwwroot\wire\core\Page.php(1475): ProcessWire\Wire->___callUnknown('hasEditPermissi...', Array) #1 [internal function]: ProcessWire\Page->___callUnknown('hasEditPermissi...', Array) #2 C:\inetpub\wwwroot\wire\core\Wire.php(348): call_user_func_array(Array, Array) #3 C:\inetpub\wwwroot\wire\core\WireHooks.php(548): ProcessWire\Wire->_callMethod('___callUnknown', Array) #4 C:\inetpub\wwwroot\wire\core\Wire.php(371): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'callUnknown', Array) #5 C:\inetpub\wwwroot\wire\core\Wire.php(372): ProcessWire\Wire->__call('callUnknown', Array) #6 C:\inetpub\wwwroot\wire\core\Wire.php(372): ProcessWire\Page->callUnknown('hasEditPermissi...', Array) #7 C:\inetpub\wwwroot\site\assets\cache\FileCompiler\site\modules\DynamicRoles\DynamicRoleSupport.module(178): ProcessWire\Wire->__call('hasEdi This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged. It's working on 2.5.4. Any help is welcome 1 Link to comment Share on other sites More sharing options...
creativejay Posted November 29, 2016 Share Posted November 29, 2016 Is DynamicRoles meant to be compatible with PW 3.x at this time? I would love to use it to control Page Publish permissions in a new installation. I see gitHub mentions of correcting installation on 2.8/3.0 but the description only mentions 2.4.5+ and I don't see a lot of recent activity for the module there. Or has some new module/Process replaced this? Link to comment Share on other sites More sharing options...
matjazp Posted November 30, 2016 Share Posted November 30, 2016 On 29. 11. 2016 at 10:19 PM, creativejay said: Is DynamicRoles meant to be compatible with PW 3.x at this time? It's meant to be, but it's not. Take this one: https://github.com/matjazpotocnik/DynamicRoles Edit on 3. Jan 2018: updated my version of droles with fixes for GH issues 14 and 16. 4 Link to comment Share on other sites More sharing options...
creativejay Posted November 30, 2016 Share Posted November 30, 2016 9 hours ago, matjazp said: It's meant to be, but it's not. Take this one: https://github.com/matjazpotocnik/DynamicRoles Perfect, thank you! Link to comment Share on other sites More sharing options...
ICF Church Posted October 17, 2017 Share Posted October 17, 2017 Hi, what would it take to make a certain drole only work on certain pages? Like if the "What can they view" selector would behave as "Where does this drole apply" My Situation: I have an editor I want to be able to edit all german translations. I want the same editor to be able to edit all translations on a specific page (his city) I create 2 droles 1. Edit rights to his city (Page ID 1234) with permission page-edit-lang-de page-edit-lang-defualt 2. Edit rights to all Pages of a certain Template and only page-edit-lang-de Now, thes two droles get combined and result in the user having edit rights on all pages (2. Drole) with german and default language. Now, if the view selector would instead restrict the drole to have only effect on the selected page(s) – this would solve my problem (and probably those of many others since this would allow for truely dynamic role model. Does this description make sense? Link to comment Share on other sites More sharing options...
thetuningspoon Posted January 26, 2018 Share Posted January 26, 2018 Why did I not know about this module until now? Link to comment Share on other sites More sharing options...
Mats Posted January 9, 2019 Share Posted January 9, 2019 This module crashed a site that was upgraded to ProcessWire 3.0.123. Anyone else seen this? Link to comment Share on other sites More sharing options...
matjazp Posted January 9, 2019 Share Posted January 9, 2019 Did you try this version: https://github.com/matjazpotocnik/DynamicRoles ? 1 Link to comment Share on other sites More sharing options...
Mats Posted January 9, 2019 Share Posted January 9, 2019 @matjazp Thanks, i did but the error persisted. Should have mentioned it. Link to comment Share on other sites More sharing options...
Mats Posted January 10, 2019 Share Posted January 10, 2019 Seems like the has_parent field in combination with a page-id was the culprit. Link to comment Share on other sites More sharing options...
matjazp Posted January 10, 2019 Share Posted January 10, 2019 Could you provide information on how to duplicate? Link to comment Share on other sites More sharing options...
Mats Posted January 10, 2019 Share Posted January 10, 2019 @matjazp I haven't figured out why some pages didn't work while others seems to work with the same selector combination. This is what it looks like in the admin: When i removed the has_parent selector the error resolved. Link to comment Share on other sites More sharing options...
matjazp Posted January 11, 2019 Share Posted January 11, 2019 It looks like that's the problem of pagefinder and not DynamicRoles. Please try reversing the selectors, first has_parent and then id (has_parent|id=1631). 4 Link to comment Share on other sites More sharing options...
Mats Posted January 11, 2019 Share Posted January 11, 2019 Reversing the selectors worked well, thanks. Link to comment Share on other sites More sharing options...
uliverse Posted March 14, 2019 Share Posted March 14, 2019 On 1/9/2019 at 8:11 PM, matjazp said: Did you try this version: https://github.com/matjazpotocnik/DynamicRoles ? I installed this module and it generally seems to work with PW 3.0.123. However, I am logged out of the backend every few seconds. Has anyone else experienced this? 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