fix(acl): align top-menu permissions, parents, and dead keys - #17012
Open
Ibochkarev wants to merge 3 commits into
Open
fix(acl): align top-menu permissions, parents, and dead keys#17012Ibochkarev wants to merge 3 commits into
Ibochkarev wants to merge 3 commits into
Conversation
Unify menu and page/processor keys for Error Log and Menus, drop the non-enforced logout gate, and migrate existing installs without elevating menu-only grants. Refs modxcms#14498.
Give Media, Access, and Gear parents menu_media / menu_access / menu_system so they no longer share child page keys. Drop unused about, credits, export_static, and stale menu_* keys from core policies. Refs modxcms#14498.
Keep function declarations out of the upgrade runner so PSR-1 SideEffects passes. Refs modxcms#14498.
This was referenced Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Menu rows, controllers, and processors used different Access Policy keys for the same screens. Parent folders also reused child page keys, so denying System Settings hid the whole Gear menu.
This PR:
error_log_view(dropsview_eventlog)system/actiononmenus(dropsactions)logoutmenu gate (logout controller/processor already allow exit)menu_media(browser staysfile_manager)menu_access(ACL / Resource Groups / Flush Permissions stayaccess_permissions)menu_system(System Settings stayssettings)about,credits,export_static,menu_security,menu_support,menu_toolsmgr_log_view, parent keys,settings/file_manager/access_permissions)Upgrade script
setup/includes/upgrades/common/3.3.0-top-menu-access-policy.php(wired frommysql/3.3.0-pl.php):menu_media/menu_access/menu_systemwhen the old shared key was present (keeps parent visibility)view_eventlog→error_log_vieworactions→menus(no page-level privilege gain)modAccessPermissionrowsmenu_mediaandmenu_accessexist on AdministratorTemplateLeft unchanged on purpose:
menu_site,components,menu_trash(already parent-specific / live). Nomenu_content/menu_packages/trash_viewrenames from #16595.How to test
core/vendor/bin/phpunit -c _build/test/phpunit.xml --filter TopMenuAccessPolicyTest→ exit 0 (13 tests)php -lon touched PHP fileserror_log_view→ Error Log menu and?a=system/eventboth failmenus→ Menus menu,?a=system/action, and Menu processors failsettings, keepmenu_system→ Gear visible, System Settings blockedfile_manager, keepmenu_media→ Media visible, Browser blocked; Sources still usesourcesmenu_access→ Access parent hidden even withview_userlogoutcan still leave the managerview_eventlogoractionsdoes not gainerror_log_view/menusafter upgradeRelated issue(s)/PR(s)
Refs #14498 (2026 suggested shape). Does not close the full 2019 umbrella.
Related: #16595 (earlier parent/dead-key attempt), #17010 (Media ACL), #14467 (Trash).
Compatibility notes
Existing installs need the 3.3.0-pl upgrade path. Extras that call
hasPermission('actions')orhasPermission('view_eventlog')must switch tomenus/error_log_view.If another open PR also adds
setup/includes/upgrades/mysql/3.3.0-pl.php, merge bothincludelines on land.Breaking change assessment
Yes. Retired ACL keys and new parent keys change default policy data and menu gates. Upgrade preserves parent visibility for users who had the old shared keys. It does not grant page access from menu-only aliases.
Test coverage
_build/test/Tests/Controllers/TopMenuAccessPolicyTest.php— transport map, controllers/processors, dead/parent keys, upgrade helpers (composite tokens, parent grants, explicit parent deny).Contributors
@Ruslan-Aleev — original report and #16595 shape.
AI tool use
Cursor agent used for implementation, review, and PR drafting.