Module Manager permissions not fully respected

Search
Other Bug Reports questions
Forum

Module Manager permissions not fully respected

TH's Avatar TH
I'm using the free version of Advanced Module Manager (v9.2.0) on Joomla 4.1.5.

It's my understanding that Advanced Module Manager is supposed to use the core Module Manager permission rules. There appears to be a bug in this implementation.

I've configured the ACLs of the core Module Manager to allow Create, Delete, and Edit actions for a particular user group. However, this user group is unable to perform those actions. For users in this user group, the "New" and "Actions" buttons do not appear on the administrator component page. The "Save" and "Save & Close" buttons do not appear on any module edit screens. When attempting to create a module using the quick icons from the home dashboard, the user gets a "Create record not permitted" error. Only super users are able to perform these actions.

I've identified two possible areas in the code where I believe the bug exist:
File: administrator/components/com_advancedmodules/src/View/Module/HtmlView.php
Method: display
Line: 77
$this->canDo = ContentHelper::getActions('com_advancedmodules', 'module', $this->item->id);
File: administrator/components/com_advancedmodules/src/View/Modules/HtmlView.php
Method: addToolbar
Line: 192
$canDo = ContentHelper::getActions('com_advancedmodules');

In both places, using 'com_modules' as the first parameter to the ContentHelper::getActions call (instead of 'com_advancedmodules') appears to partially fix the issue for me, although I'm still having issues creating new modules.
Peter van Westen's Avatar Peter van Westen ADMIN
Yup, you are completely right.
This is now fixed in the latest development release:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
TH's Avatar TH
While I can now edit and duplicate existing modules, I'm still having trouble creating new modules.

I think the problem might be in file:
administrator/components/com_advancedmodules/src/Controller/ModuleController.php where Joomla\CMS\MVC\Controller\FormController is extended.

Joomla\CMS\MVC\Controller\FormController specifies an allowAdd method that does not appear to be overridden by RegularLabs\Component\AdvancedModules\Administrator\Controller\ModuleController. This method may need overridden since the $this->option passed to $user->authorise() is com_advancedmodules and not com_modules.
Peter van Westen's Avatar Peter van Westen ADMIN
Good catch. Also fixed now.
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
TH's Avatar TH
Thanks for the quick turnaround! Everything is working as expected now!
You can only post on this forum if you log in