fix(acl): align top-menu permissions, parents, and dead keys - #3
Open
Ibochkarev wants to merge 3 commits into
Open
fix(acl): align top-menu permissions, parents, and dead keys#3Ibochkarev 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 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.
Что сделано
Строки меню, контроллеры и процессоры использовали разные ключи Access Policy для одних и тех же экранов. Родительские папки тоже переиспользовали ключи дочерних страниц, поэтому запрет System Settings прятал всё меню Gear.
Этот PR:
error_log_view(убираетview_eventlog).system/actionнаmenus(убираетactions).logout(контроллер/процессор logout и так разрешают выход).menu_media(browser остаётсяfile_manager).menu_access(ACL / Resource Groups / Flush Permissions остаютсяaccess_permissions).menu_system(System Settings остаётсяsettings).about,credits,export_static,menu_security,menu_support,menu_tools.mgr_log_view, родительские ключи,settings/file_manager/access_permissions).Скрипт апгрейда
setup/includes/upgrades/common/3.3.0-top-menu-access-policy.php(подключён изmysql/3.3.0-pl.php):menu_media/menu_access/menu_system, если присутствовал старый общий ключ (сохраняет видимость родителя).view_eventlog→error_log_viewилиactions→menus(без прироста привилегий уровня страницы).modAccessPermission.menu_mediaиmenu_accessна AdministratorTemplate.Намеренно не тронуто:
menu_site,components,menu_trash(уже родитель-специфичные / живые). Без переименованийmenu_content/menu_packages/trash_viewиз modxcms#16595.Как проверить
core/vendor/bin/phpunit -c _build/test/phpunit.xml --filter TopMenuAccessPolicyTest→ exit 0 (13 тестов).php -lна затронутых PHP-файлах.error_log_view→ меню Error Log и?a=system/eventоба недоступны.menus→ меню Menus,?a=system/actionи процессоры меню недоступны.settings, оставьтеmenu_system→ Gear виден, System Settings заблокирован.file_manager, оставьтеmenu_media→ Media виден, Browser заблокирован. Sources по-прежнему используютsources.menu_access→ родитель Access скрыт даже сview_user.logoutвсё равно может выйти из менеджера.view_eventlogилиactionsне получаетerror_log_view/menus.Совместимость
Менеджер UI + английский лексикон. Без изменения коннекторов или API процессоров. Безопасно для 3.x patch.
Оригинал: modxcms#17012