? ? Pending

User tests: Successful: Unsuccessful:

avatar Harmageddon
Harmageddon
26 Sep 2020

Version: Joomla! 3.x

In #6113, the permission check for editing a module in frontend was checked from "return error if user is not allowed to edit this module OR if user is not allowed to edit any module" to "return error if user is not allowed to edit this module AND if user is not allowed to edit any module". The intention was to allow users to edit a single module even if they are lacking the general permission to edit modules in frontend.
However, this introduces a problem for the inverse case: A user that generally may edit frontend modules, but should not be allowed to edit one particular module. For this case, the "OR" construction worked and the "AND" doesn't.

Summary of Changes

I suggest to get rid of the check of the general permission. If there are no permission rules for the particular module, Joomla's ACL has an automatic fallback to the general permissions for frontend module editing. So I don't see any need to check both rules. Please correct me if I'm mistaken!

Testing Instructions

For the frontend steps, you need a user who is no "Super Administrator", but in another user group, for example "Administrator". For the backend steps, use your "Super Administrator" account or at least an account who has the permissions to edit permissions.

  1. Backend: Navigate to "Extensions - Modules - Options". Under "Permissions", set the "Frontend Editing" permission for the "Administrator" user group to "inherited". This should result to a calculated permission of "Not Allowed (Inherited)".
  2. Backend: Edit a module. In the "Permissions" tab, set the "Frontend Editing" permission for "Administrator" to "Allowed". Hit "Save and Close".
  3. Frontend: Make sure you can edit this particular module and no other module. While editing the module, save the URL of the edit form for later usage. Change something and hit "Save and Close".
  4. Backend: Navigate to "Extensions - Modules - Options". Under "Permissions", set the "Frontend Editing" permission for the "Administrator" user group to "Allowed".
  5. Frontend: Make sure you can edit and save all modules on the site.
  6. Backend: Edit a module. In the "Permissions" tab, set the "Frontend Editing" permission for "Administrator" to "Denied". Hit "Save and Close".
  7. Frontend: Make sure that there is no button to edit this particular module. For all others however, the button is there. Make sure you still can edit all other modules by changing values and saving them.
  8. Frontend: Nevertheless, try to access the module edit form using the URL you saved in step 3. Change some values and hit "Save and Close".

Actual result BEFORE applying this Pull Request

Although you shouldn't be allowed to do this, you can edit the module in step 8.

Expected result AFTER applying this Pull Request

Step 8 should result in a "You are not allowed to view this resource" error. All other steps should still work like before (e.g. follow the ACL permissions).

Documentation Changes Required

None

avatar Harmageddon Harmageddon - open - 26 Sep 2020
avatar Harmageddon Harmageddon - change - 26 Sep 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Sep 2020
Category Front End com_config
avatar Harmageddon Harmageddon - change - 26 Sep 2020
The description was changed
avatar Harmageddon Harmageddon - edited - 26 Sep 2020
avatar richard67
richard67 - comment - 30 Sep 2020

@Harmageddon Could you merge latest staging of the cms repo into your branch for this PR to get the latest updates from the CMS? There was an error in the staging branch for a while which is fixed now, and this error made all system and unit tests fail, so we can't really see if they would be successful for your PR or not. Thanks in advance.

avatar Harmageddon Harmageddon - change - 1 Oct 2020
Labels Added: ?
avatar Harmageddon
Harmageddon - comment - 1 Oct 2020

I rebased it and the tests passed. Thank you!

avatar gostn gostn - test_item - 10 Oct 2020 - Tested successfully
avatar gostn
gostn - comment - 10 Oct 2020

I have tested this item successfully on fd18571

Perfect test instructions!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30778.

avatar ChristineWk ChristineWk - test_item - 24 Oct 2020 - Tested successfully
avatar ChristineWk
ChristineWk - comment - 24 Oct 2020

I have tested this item successfully on fd18571

Phew :-) Thanks for your instructions!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30778.

avatar richard67 richard67 - change - 24 Oct 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 24 Oct 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30778.

avatar rdeutz rdeutz - change - 30 Oct 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-10-30 12:48:32
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 30 Oct 2020
avatar rdeutz rdeutz - merge - 30 Oct 2020

Add a Comment

Login with GitHub to post a comment