From 110336e76efac005d7066128cb95f0912d32d711 Mon Sep 17 00:00:00 2001 From: Ruslan-Aleev Date: Fri, 26 Jul 2024 14:50:06 +0400 Subject: [PATCH 1/8] Remove unused menu permissions --- .../transport.policy.tpl.administrator.php | 25 ----------- _build/data/transport.core.accesspolicies.php | 6 +-- core/lexicon/en/permissions.inc.php | 5 --- .../3.1.0-policy-permissions-menu-update.php | 41 +++++++++++++++++++ setup/includes/upgrades/mysql/3.1.0-pl.php | 1 + setup/lang/en/upgrades.inc.php | 4 ++ 6 files changed, 49 insertions(+), 33 deletions(-) create mode 100644 setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php diff --git a/_build/data/permissions/transport.policy.tpl.administrator.php b/_build/data/permissions/transport.policy.tpl.administrator.php index 333dff8762e..6338ecdfdfb 100644 --- a/_build/data/permissions/transport.policy.tpl.administrator.php +++ b/_build/data/permissions/transport.policy.tpl.administrator.php @@ -10,11 +10,6 @@ use MODX\Revolution\modAccessPermission; $permissions = []; -$permissions[] = $xpdo->newObject(modAccessPermission::class, [ - 'name' => 'about', - 'description' => 'perm.about_desc', - 'value' => true, -]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'access_permissions', 'description' => 'perm.access_permissions_desc', @@ -65,11 +60,6 @@ 'description' => 'perm.create_desc', 'value' => true, ]); -$permissions[] = $xpdo->newObject(modAccessPermission::class, [ - 'name' => 'credits', - 'description' => 'perm.credits_desc', - 'value' => true, -]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'customize_forms', 'description' => 'perm.customize_forms_desc', @@ -285,11 +275,6 @@ 'description' => 'perm.error_log_view_desc', 'value' => true, ]); -$permissions[] = $xpdo->newObject(modAccessPermission::class, [ - 'name' => 'export_static', - 'description' => 'perm.export_static_desc', - 'value' => true, -]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'file_create', 'description' => 'perm.file_create_desc', @@ -400,21 +385,11 @@ 'description' => 'perm.menu_reports_desc', 'value' => true, ]); -$permissions[] = $xpdo->newObject(modAccessPermission::class, [ - 'name' => 'menu_security', - 'description' => 'perm.menu_security_desc', - 'value' => true, -]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'menu_site', 'description' => 'perm.menu_site_desc', 'value' => true, ]); -$permissions[] = $xpdo->newObject(modAccessPermission::class, [ - 'name' => 'menu_support', - 'description' => 'perm.menu_support_desc', - 'value' => true, -]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'menu_system', 'description' => 'perm.menu_system_desc', diff --git a/_build/data/transport.core.accesspolicies.php b/_build/data/transport.core.accesspolicies.php index f63910e0fa3..6159af96815 100644 --- a/_build/data/transport.core.accesspolicies.php +++ b/_build/data/transport.core.accesspolicies.php @@ -23,15 +23,15 @@ function jsonifyPermissions(array $permissions = []) { $corePermissions = [ modAccessPolicy::POLICY_RESOURCE => ['add_children', 'create', 'copy', 'delete', 'list', 'load', 'move', 'publish', 'remove', 'save', 'steal_lock', 'undelete', 'unpublish', 'view'], - modAccessPolicy::POLICY_ADMINISTRATOR => ['about', 'access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'credits', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'export_static', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_reports', 'menu_security', 'menu_site', 'menu_support', 'menu_system', 'menu_tools', 'menu_trash', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_reports', 'menu_site', 'menu_system', 'menu_tools', 'menu_trash', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_LOAD_ONLY => ['load'], modAccessPolicy::POLICY_LOAD_LIST_VIEW => ['load', 'list', 'view'], modAccessPolicy::POLICY_OBJECT => ['load', 'list', 'view', 'save', 'remove'], modAccessPolicy::POLICY_ELEMENT => ['add_children', 'create', 'delete', 'list', 'load', 'remove', 'save', 'view', 'copy'], - modAccessPolicy::POLICY_CONTENT_EDITOR => ['change_profile', 'class_map', 'countries', 'delete_document', 'delete_static_resource', 'delete_symlink', 'delete_weblink', 'edit_document', 'edit_static_resource', 'edit_symlink', 'edit_weblink', 'frames', 'help', 'home', 'language', 'list', 'load', 'logout', 'menu_reports', 'menu_site', 'menu_support', 'menu_tools', 'menu_user', 'new_document', 'new_static_resource', 'new_symlink', 'new_weblink', 'resource_duplicate', 'resource_tree', 'save_document', 'source_view', 'tree_show_resource_ids', 'view', 'view_document', 'view_template'], + modAccessPolicy::POLICY_CONTENT_EDITOR => ['change_profile', 'class_map', 'countries', 'delete_document', 'delete_static_resource', 'delete_symlink', 'delete_weblink', 'edit_document', 'edit_static_resource', 'edit_symlink', 'edit_weblink', 'frames', 'help', 'home', 'language', 'list', 'load', 'logout', 'menu_reports', 'menu_site', 'menu_tools', 'menu_user', 'new_document', 'new_static_resource', 'new_symlink', 'new_weblink', 'resource_duplicate', 'resource_tree', 'save_document', 'source_view', 'tree_show_resource_ids', 'view', 'view_document', 'view_template'], modAccessPolicy::POLICY_MEDIA_SOURCE_ADMIN => ['create', 'copy', 'load', 'list', 'save', 'remove', 'view'], modAccessPolicy::POLICY_MEDIA_SOURCE_USER => ['load', 'list', 'view'], - modAccessPolicy::POLICY_DEVELOPER => ['about', 'change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'credits', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'export_static', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_reports', 'menu_site', 'menu_support', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_reports', 'menu_site', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_CONTEXT => ['load', 'list', 'view', 'save', 'remove', 'copy', 'view_unpublished'], modAccessPolicy::POLICY_HIDDEN_NAMESPACE => ['load' => false, 'list' => false, 'view' => true], ]; diff --git a/core/lexicon/en/permissions.inc.php b/core/lexicon/en/permissions.inc.php index 43d2ae252d5..e187680f92a 100644 --- a/core/lexicon/en/permissions.inc.php +++ b/core/lexicon/en/permissions.inc.php @@ -6,7 +6,6 @@ * @package modx * @subpackage lexicon */ -$_lang['perm.about_desc'] = 'The About page.'; $_lang['perm.access_permissions_desc'] = 'Any Access Permission-related pages and actions.'; $_lang['perm.actions_desc'] = 'The Actions page.'; $_lang['perm.add_children_desc'] = 'To add any Resources as children of the specified Resource or Elements to a Category.'; @@ -19,7 +18,6 @@ $_lang['perm.copy_desc'] = 'The ability to copy an object.'; $_lang['perm.countries_desc'] = 'To view a list of countries.'; $_lang['perm.create_desc'] = 'Basic "create" access on new objects.'; -$_lang['perm.credits_desc'] = 'View the Credits page.'; $_lang['perm.customize_forms_desc'] = 'View and manage the Form Customization page.'; $_lang['perm.dashboards_desc'] = 'View and manage Custom Dashboards.'; $_lang['perm.database_desc'] = 'The System Info page.'; @@ -64,7 +62,6 @@ $_lang['perm.empty_cache_desc'] = 'To empty the site cache.'; $_lang['perm.error_log_erase_desc'] = 'To erase the error log.'; $_lang['perm.error_log_view_desc'] = 'To view the error log.'; -$_lang['perm.export_static_desc'] = 'To export the site to static HTML.'; $_lang['perm.file_create_desc'] = 'To create a file.'; $_lang['perm.file_list_desc'] = 'To list files within a given physical directory.'; $_lang['perm.file_manager_desc'] = 'To use the file manager utility.'; @@ -87,9 +84,7 @@ $_lang['perm.mgr_log_view_desc'] = 'To view the manager action log.'; $_lang['perm.mgr_log_erase_desc'] = 'To clear the manager action log.'; $_lang['perm.menu_reports_desc'] = 'Show the main menu item "Reports".'; -$_lang['perm.menu_security_desc'] = 'Show the main menu item "Security".'; $_lang['perm.menu_site_desc'] = 'Show the main menu item "Site".'; -$_lang['perm.menu_support_desc'] = 'Show the main menu item "Support".'; $_lang['perm.menu_system_desc'] = 'Show the main menu item "System".'; $_lang['perm.menu_tools_desc'] = 'Show the main menu item "Tools".'; $_lang['perm.menu_trash_desc'] = 'Show the main menu item "Trash Manager".'; diff --git a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php new file mode 100644 index 00000000000..84442a604f2 --- /dev/null +++ b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php @@ -0,0 +1,41 @@ +newQuery(modAccessPermission::class); + $c->where([ + 'name' => $permissionItem, + 'template:IN' => $defaultAaccessPolicyTemplateIds, + ]); + $permissions = $modx->getIterator(modAccessPermission::class, $c); + + foreach($permissions as $permission) { + if ($permission instanceof modAccessPermission) { + if ($permission->remove()) { + $this->runner->addResult( + modInstallRunner::RESULT_SUCCESS, + sprintf($messageTemplate, 'ok', $this->install->lexicon('permission_remove_success', ['name' => $permissionItem])) + ); + } else { + $this->runner->addResult( + modInstallRunner::RESULT_WARNING, + sprintf($messageTemplate, 'warning', $this->install->lexicon('permission_remove_failed', ['name' => $permissionItem])) + ); + } + } + } +} \ No newline at end of file diff --git a/setup/includes/upgrades/mysql/3.1.0-pl.php b/setup/includes/upgrades/mysql/3.1.0-pl.php index ab985fbd2ab..ff41ffe6edc 100644 --- a/setup/includes/upgrades/mysql/3.1.0-pl.php +++ b/setup/includes/upgrades/mysql/3.1.0-pl.php @@ -11,3 +11,4 @@ include dirname(__DIR__) . '/common/3.1.0-remove-deprecated-resource-fields.php'; include dirname(__DIR__) . '/common/3.1.0-modify-usergrouprole-authority-index.php'; include dirname(__DIR__) . '/common/3.1.0-trash-menu.php'; +include dirname(__DIR__) . '/common/3.1.0-policy-permissions-menu-update.php'; diff --git a/setup/lang/en/upgrades.inc.php b/setup/lang/en/upgrades.inc.php index df41e6937e7..6487ef3ae61 100644 --- a/setup/lang/en/upgrades.inc.php +++ b/setup/lang/en/upgrades.inc.php @@ -39,6 +39,10 @@ $_lang['menu_update_success'] = 'Menu item `[[+text]]` updated.'; $_lang['menu_update_failed'] = 'Menu item `[[+text]]` could not be updated.'; $_lang['modify_column'] = 'Modified column `[[+column]]` from `[[+old]]` to `[[+new]]` on table [[+table]]'; +$_lang['permission_remove_success'] = 'Access Permission `[[+name]]` removed.'; +$_lang['permission_remove_failed'] = 'Access Permission `[[+name]]` could not be removed.'; +$_lang['permission_update_success'] = 'Access Permission `[[+name]]` updated.'; +$_lang['permission_update_failed'] = 'Access Permission `[[+name]]` could not be updated.'; $_lang['rename_column'] = 'Renamed column `[[+old]]` to `[[+new]]` on table [[+table]].'; $_lang['rename_table'] = 'Renamed table `[[+old]]` to `[[+new]]`.'; $_lang['remove_fulltext_index'] = 'Removed full-text index `[[+index]]`.'; From 61dccd9b907043cb03c4805b94ddfea4213da0a9 Mon Sep 17 00:00:00 2001 From: Ruslan-Aleev Date: Fri, 26 Jul 2024 17:54:54 +0400 Subject: [PATCH 2/8] Update 'menu_site' permission --- .../transport.policy.tpl.administrator.php | 8 +-- _build/data/transport.core.accesspolicies.php | 6 +-- _build/data/transport.core.menus.php | 2 +- core/lexicon/en/permissions.inc.php | 2 +- .../3.1.0-policy-permissions-menu-update.php | 53 ++++++++++++++++++- 5 files changed, 61 insertions(+), 10 deletions(-) diff --git a/_build/data/permissions/transport.policy.tpl.administrator.php b/_build/data/permissions/transport.policy.tpl.administrator.php index 6338ecdfdfb..82e9aa5b581 100644 --- a/_build/data/permissions/transport.policy.tpl.administrator.php +++ b/_build/data/permissions/transport.policy.tpl.administrator.php @@ -381,13 +381,13 @@ 'value' => true, ]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ - 'name' => 'menu_reports', - 'description' => 'perm.menu_reports_desc', + 'name' => 'menu_content', + 'description' => 'perm.menu_content_desc', 'value' => true, ]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ - 'name' => 'menu_site', - 'description' => 'perm.menu_site_desc', + 'name' => 'menu_reports', + 'description' => 'perm.menu_reports_desc', 'value' => true, ]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ diff --git a/_build/data/transport.core.accesspolicies.php b/_build/data/transport.core.accesspolicies.php index 6159af96815..61de382fc49 100644 --- a/_build/data/transport.core.accesspolicies.php +++ b/_build/data/transport.core.accesspolicies.php @@ -23,15 +23,15 @@ function jsonifyPermissions(array $permissions = []) { $corePermissions = [ modAccessPolicy::POLICY_RESOURCE => ['add_children', 'create', 'copy', 'delete', 'list', 'load', 'move', 'publish', 'remove', 'save', 'steal_lock', 'undelete', 'unpublish', 'view'], - modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_reports', 'menu_site', 'menu_system', 'menu_tools', 'menu_trash', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_reports', 'menu_system', 'menu_tools', 'menu_trash', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_LOAD_ONLY => ['load'], modAccessPolicy::POLICY_LOAD_LIST_VIEW => ['load', 'list', 'view'], modAccessPolicy::POLICY_OBJECT => ['load', 'list', 'view', 'save', 'remove'], modAccessPolicy::POLICY_ELEMENT => ['add_children', 'create', 'delete', 'list', 'load', 'remove', 'save', 'view', 'copy'], - modAccessPolicy::POLICY_CONTENT_EDITOR => ['change_profile', 'class_map', 'countries', 'delete_document', 'delete_static_resource', 'delete_symlink', 'delete_weblink', 'edit_document', 'edit_static_resource', 'edit_symlink', 'edit_weblink', 'frames', 'help', 'home', 'language', 'list', 'load', 'logout', 'menu_reports', 'menu_site', 'menu_tools', 'menu_user', 'new_document', 'new_static_resource', 'new_symlink', 'new_weblink', 'resource_duplicate', 'resource_tree', 'save_document', 'source_view', 'tree_show_resource_ids', 'view', 'view_document', 'view_template'], + modAccessPolicy::POLICY_CONTENT_EDITOR => ['change_profile', 'class_map', 'countries', 'delete_document', 'delete_static_resource', 'delete_symlink', 'delete_weblink', 'edit_document', 'edit_static_resource', 'edit_symlink', 'edit_weblink', 'frames', 'help', 'home', 'language', 'list', 'load', 'logout', 'menu_content', 'menu_reports', 'menu_tools', 'menu_user', 'new_document', 'new_static_resource', 'new_symlink', 'new_weblink', 'resource_duplicate', 'resource_tree', 'save_document', 'source_view', 'tree_show_resource_ids', 'view', 'view_document', 'view_template'], modAccessPolicy::POLICY_MEDIA_SOURCE_ADMIN => ['create', 'copy', 'load', 'list', 'save', 'remove', 'view'], modAccessPolicy::POLICY_MEDIA_SOURCE_USER => ['load', 'list', 'view'], - modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_reports', 'menu_site', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_CONTEXT => ['load', 'list', 'view', 'save', 'remove', 'copy', 'view_unpublished'], modAccessPolicy::POLICY_HIDDEN_NAMESPACE => ['load' => false, 'list' => false, 'view' => true], ]; diff --git a/_build/data/transport.core.menus.php b/_build/data/transport.core.menus.php index a7ee89b2078..1048e672c11 100644 --- a/_build/data/transport.core.menus.php +++ b/_build/data/transport.core.menus.php @@ -22,7 +22,7 @@ [ 'text' => 'site', 'description' => '', - 'permissions' => 'menu_site', + 'permissions' => 'menu_content', 'action' => '', 'icon' => '', 'children' => [ diff --git a/core/lexicon/en/permissions.inc.php b/core/lexicon/en/permissions.inc.php index e187680f92a..dfb1b19a1b8 100644 --- a/core/lexicon/en/permissions.inc.php +++ b/core/lexicon/en/permissions.inc.php @@ -83,8 +83,8 @@ $_lang['perm.logout_desc'] = 'To be able to logout as a user.'; $_lang['perm.mgr_log_view_desc'] = 'To view the manager action log.'; $_lang['perm.mgr_log_erase_desc'] = 'To clear the manager action log.'; +$_lang['perm.menu_content_desc'] = 'Show the main menu item "Content".'; $_lang['perm.menu_reports_desc'] = 'Show the main menu item "Reports".'; -$_lang['perm.menu_site_desc'] = 'Show the main menu item "Site".'; $_lang['perm.menu_system_desc'] = 'Show the main menu item "System".'; $_lang['perm.menu_tools_desc'] = 'Show the main menu item "Tools".'; $_lang['perm.menu_trash_desc'] = 'Show the main menu item "Trash Manager".'; diff --git a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php index 84442a604f2..9430fa2d89c 100644 --- a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php +++ b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php @@ -8,9 +8,18 @@ */ use MODX\Revolution\modAccessPermission; +use MODX\Revolution\modMenu; $defaultAaccessPolicyTemplateIds = [1, 2, 3, 4, 5, 6, 7]; $permissionsRemove = ['about', 'credits', 'export_static', 'menu_security', 'menu_support']; +$permissionsUpdate = [ + 'menu_site' => [ + 'name' => 'menu_content', + 'description' => 'perm.menu_content_desc', + 'menu_text' => 'site', + 'menu_only' => false, + ], +]; // Remove permissions foreach ($permissionsRemove as $permissionItem) { @@ -23,7 +32,7 @@ ]); $permissions = $modx->getIterator(modAccessPermission::class, $c); - foreach($permissions as $permission) { + foreach ($permissions as $permission) { if ($permission instanceof modAccessPermission) { if ($permission->remove()) { $this->runner->addResult( @@ -38,4 +47,46 @@ } } } +} + +// Update permissions +foreach ($permissionsUpdate as $permissionName => $permissionItem) { + /** @var modAccessPermission $permission */ + $c = $modx->newQuery(modAccessPermission::class); + $c->where([ + 'name' => $permissionName, + 'template:IN' => $defaultAaccessPolicyTemplateIds, + ]); + $permissions = $modx->getIterator(modAccessPermission::class, $c); + + foreach ($permissions as $permission) { + if ($permission instanceof modAccessPermission) { + // Update only menu or menu and permission + if ($permissionItem['menu_only']) { + $permission->set('name', $permissionName); + } else { + $permission->set('name', $permissionItem['name']); + $permission->set('description', $permissionItem['description']); + } + + if ($permission->save()) { + $this->runner->addResult( + modInstallRunner::RESULT_SUCCESS, + sprintf($messageTemplate, 'ok', $this->install->lexicon('permission_update_success', ['name' => $permissionName])) + ); + + // Update menu item + $menuItem = $modx->getObject(modMenu::class, ['text' => $permissionItem['menu_text'], 'permissions' => $permissionName]); + if ($menuItem) { + $menuItem->set('permissions', $permissionItem['name']); + $menuItem->save(); + } + } else { + $this->runner->addResult( + modInstallRunner::RESULT_WARNING, + sprintf($messageTemplate, 'warning', $this->install->lexicon('permission_update_failed', ['name' => $permissionName])) + ); + } + } + } } \ No newline at end of file From ac8793c40599557dddebc8673b8050ef0ec2f44e Mon Sep 17 00:00:00 2001 From: Ruslan-Aleev Date: Fri, 26 Jul 2024 17:59:23 +0400 Subject: [PATCH 3/8] Update 'menu_trash' permission --- .../transport.policy.tpl.administrator.php | 10 +-- _build/data/transport.core.accesspolicies.php | 2 +- core/lexicon/en/permissions.inc.php | 2 +- manager/assets/modext/core/modx.layout.js | 73 +++++++++++-------- .../default/resource/trash.class.php | 2 +- .../3.1.0-policy-permissions-menu-update.php | 6 ++ 6 files changed, 56 insertions(+), 39 deletions(-) diff --git a/_build/data/permissions/transport.policy.tpl.administrator.php b/_build/data/permissions/transport.policy.tpl.administrator.php index 82e9aa5b581..f934d2c172c 100644 --- a/_build/data/permissions/transport.policy.tpl.administrator.php +++ b/_build/data/permissions/transport.policy.tpl.administrator.php @@ -400,11 +400,6 @@ 'description' => 'perm.menu_tools_desc', 'value' => true, ]); -$permissions[] = $xpdo->newObject(modAccessPermission::class, [ - 'name' => 'menu_trash', - 'description' => 'perm.menu_trash_desc', - 'value' => true, -]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'menu_user', 'description' => 'perm.menu_user_desc', @@ -750,6 +745,11 @@ 'description' => 'perm.steal_locks_desc', 'value' => true, ]); +$permissions[] = $xpdo->newObject(modAccessPermission::class, [ + 'name' => 'trash_view', + 'description' => 'perm.trash_view_desc', + 'value' => true, +]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'tree_show_element_ids', 'description' => 'perm.tree_show_element_ids_desc', diff --git a/_build/data/transport.core.accesspolicies.php b/_build/data/transport.core.accesspolicies.php index 61de382fc49..668d9582939 100644 --- a/_build/data/transport.core.accesspolicies.php +++ b/_build/data/transport.core.accesspolicies.php @@ -23,7 +23,7 @@ function jsonifyPermissions(array $permissions = []) { $corePermissions = [ modAccessPolicy::POLICY_RESOURCE => ['add_children', 'create', 'copy', 'delete', 'list', 'load', 'move', 'publish', 'remove', 'save', 'steal_lock', 'undelete', 'unpublish', 'view'], - modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_reports', 'menu_system', 'menu_tools', 'menu_trash', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'trash_view', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_LOAD_ONLY => ['load'], modAccessPolicy::POLICY_LOAD_LIST_VIEW => ['load', 'list', 'view'], modAccessPolicy::POLICY_OBJECT => ['load', 'list', 'view', 'save', 'remove'], diff --git a/core/lexicon/en/permissions.inc.php b/core/lexicon/en/permissions.inc.php index dfb1b19a1b8..6eeb7cd329a 100644 --- a/core/lexicon/en/permissions.inc.php +++ b/core/lexicon/en/permissions.inc.php @@ -87,7 +87,6 @@ $_lang['perm.menu_reports_desc'] = 'Show the main menu item "Reports".'; $_lang['perm.menu_system_desc'] = 'Show the main menu item "System".'; $_lang['perm.menu_tools_desc'] = 'Show the main menu item "Tools".'; -$_lang['perm.menu_trash_desc'] = 'Show the main menu item "Trash Manager".'; $_lang['perm.menu_user_desc'] = 'Show the main menu item "User".'; $_lang['perm.menus_desc'] = 'To edit or save any main Menu items.'; $_lang['perm.messages_desc'] = 'To send or view any personal Messages.'; @@ -160,6 +159,7 @@ $_lang['perm.sources_desc'] = 'To manage Media Sources and Media Source Types.'; $_lang['perm.steal_lock_desc'] = 'To "steal", or delete, a lock from a Resource.'; $_lang['perm.steal_locks_desc'] = 'To "steal" locks, overriding a current lock on a Resource.'; +$_lang['perm.trash_view_desc'] = 'To view a Trash Manager.'; $_lang['perm.tree_show_resource_ids_desc'] = 'Show the IDs in the Resource tree.'; $_lang['perm.tree_show_element_ids_desc'] = 'Show the IDs in the Elements tree.'; $_lang['perm.undelete_desc'] = 'Basic permission to "undelete" any object.'; diff --git a/manager/assets/modext/core/modx.layout.js b/manager/assets/modext/core/modx.layout.js index c3af2f20978..c06b0af53d8 100644 --- a/manager/assets/modext/core/modx.layout.js +++ b/manager/assets/modext/core/modx.layout.js @@ -309,38 +309,49 @@ Ext.extend(MODx.Layout, Ext.Viewport, { listeners: { success: { fn: function(response) { - const trashTrigger = Object.values(response.object).find(item => item.id === 'emptifier'); - if (trashTrigger) { - const trashTab = baseTabs.add({ - id: 'modx-trash-link', - title: '', - updateState(deletedCount = 0) { - const tab = this; - const tabEl = tab.tabEl; - const tooltipTarget = new Ext.Element(tabEl); - - if (deletedCount === 0) { - tab.disable(); - tabEl.classList.remove('active'); - } else { - tab.enable(); - tabEl.classList.add('active'); - } - - tab.tooltip = new Ext.ToolTip({ - target: tooltipTarget, - title: _('trash.manage_recycle_bin_tooltip', { count: deletedCount }), - }); - }, - }); - if (!trashTrigger.disabled) { - trashTab.tabEl.classList.add('active'); - } - if (trashTrigger.tooltip) { - trashTab.tooltip = new Ext.ToolTip({ - target: new Ext.Element(trashTab.tabEl), - title: trashTrigger.tooltip + if (MODx.perm.trash_view) { + const trashTrigger = Object.values(response.object).find(item => item.id === 'emptifier'); + if (trashTrigger) { + const trashTab = baseTabs.add({ + id: 'modx-trash-link', + title: '', + updateState(deletedCount = 0) { + const tab = this; + const tabEl = tab.tabEl; + const tooltipTarget = new Ext.Element(tabEl); + + if (deletedCount === 0) { + tab.disable(); + tabEl.classList.remove('active'); + } else { + tab.enable(); + tabEl.classList.add('active'); + } + + tab.tooltip = new Ext.ToolTip({ + target: tooltipTarget, + title: _('trash.manage_recycle_bin_tooltip', { count: deletedCount }), + }); + }, }); + if (!trashTrigger.disabled) { + trashTab.tabEl.classList.add('active'); + } + if (trashTrigger.tooltip) { + trashTab.tooltip = new Ext.ToolTip({ + target: new Ext.Element(trashTab.tabEl), + title: trashTrigger.tooltip + }); + if (!trashTrigger.disabled) { + trashTab.tabEl.classList.add('active'); + } + if (trashTrigger.tooltip) { + trashTab.tooltip = new Ext.ToolTip({ + target: new Ext.Element(trashTab.tabEl), + title: trashTrigger.tooltip + }); + } + } } } }, diff --git a/manager/controllers/default/resource/trash.class.php b/manager/controllers/default/resource/trash.class.php index 08b8e0968fd..5c16c4eccc4 100644 --- a/manager/controllers/default/resource/trash.class.php +++ b/manager/controllers/default/resource/trash.class.php @@ -42,7 +42,7 @@ public function getPageTitle() */ public function checkPermissions() { - return $this->modx->hasPermission('menu_trash'); + return $this->modx->hasPermission('trash_view'); } /** diff --git a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php index 9430fa2d89c..d3d0a0e66ef 100644 --- a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php +++ b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php @@ -19,6 +19,12 @@ 'menu_text' => 'site', 'menu_only' => false, ], + 'menu_trash' => [ + 'name' => 'trash_view', + 'description' => 'perm.trash_view_desc', + 'menu_text' => '', + 'menu_only' => false, + ], ]; // Remove permissions From a13c06d9b978a5638e788ff3a02016df26705337 Mon Sep 17 00:00:00 2001 From: Ruslan-Aleev Date: Fri, 26 Jul 2024 18:07:13 +0400 Subject: [PATCH 4/8] Update 'components' permission --- .../permissions/transport.policy.tpl.administrator.php | 10 +++++----- _build/data/transport.core.accesspolicies.php | 4 ++-- _build/data/transport.core.menus.php | 2 +- core/lexicon/en/permissions.inc.php | 2 +- .../common/3.1.0-policy-permissions-menu-update.php | 6 ++++++ 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/_build/data/permissions/transport.policy.tpl.administrator.php b/_build/data/permissions/transport.policy.tpl.administrator.php index f934d2c172c..b2d12e565c6 100644 --- a/_build/data/permissions/transport.policy.tpl.administrator.php +++ b/_build/data/permissions/transport.policy.tpl.administrator.php @@ -40,11 +40,6 @@ 'description' => 'perm.class_map_desc', 'value' => true, ]); -$permissions[] = $xpdo->newObject(modAccessPermission::class, [ - 'name' => 'components', - 'description' => 'perm.components_desc', - 'value' => true, -]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'content_types', 'description' => 'perm.content_types_desc', @@ -385,6 +380,11 @@ 'description' => 'perm.menu_content_desc', 'value' => true, ]); +$permissions[] = $xpdo->newObject(modAccessPermission::class, [ + 'name' => 'menu_packages', + 'description' => 'perm.menu_packages_desc', + 'value' => true, +]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'menu_reports', 'description' => 'perm.menu_reports_desc', diff --git a/_build/data/transport.core.accesspolicies.php b/_build/data/transport.core.accesspolicies.php index 668d9582939..b3b0f3755f3 100644 --- a/_build/data/transport.core.accesspolicies.php +++ b/_build/data/transport.core.accesspolicies.php @@ -23,7 +23,7 @@ function jsonifyPermissions(array $permissions = []) { $corePermissions = [ modAccessPolicy::POLICY_RESOURCE => ['add_children', 'create', 'copy', 'delete', 'list', 'load', 'move', 'publish', 'remove', 'save', 'steal_lock', 'undelete', 'unpublish', 'view'], - modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'trash_view', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_packages', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'trash_view', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_LOAD_ONLY => ['load'], modAccessPolicy::POLICY_LOAD_LIST_VIEW => ['load', 'list', 'view'], modAccessPolicy::POLICY_OBJECT => ['load', 'list', 'view', 'save', 'remove'], @@ -31,7 +31,7 @@ function jsonifyPermissions(array $permissions = []) { modAccessPolicy::POLICY_CONTENT_EDITOR => ['change_profile', 'class_map', 'countries', 'delete_document', 'delete_static_resource', 'delete_symlink', 'delete_weblink', 'edit_document', 'edit_static_resource', 'edit_symlink', 'edit_weblink', 'frames', 'help', 'home', 'language', 'list', 'load', 'logout', 'menu_content', 'menu_reports', 'menu_tools', 'menu_user', 'new_document', 'new_static_resource', 'new_symlink', 'new_weblink', 'resource_duplicate', 'resource_tree', 'save_document', 'source_view', 'tree_show_resource_ids', 'view', 'view_document', 'view_template'], modAccessPolicy::POLICY_MEDIA_SOURCE_ADMIN => ['create', 'copy', 'load', 'list', 'save', 'remove', 'view'], modAccessPolicy::POLICY_MEDIA_SOURCE_USER => ['load', 'list', 'view'], - modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'components', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_packages', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_CONTEXT => ['load', 'list', 'view', 'save', 'remove', 'copy', 'view_unpublished'], modAccessPolicy::POLICY_HIDDEN_NAMESPACE => ['load' => false, 'list' => false, 'view' => true], ]; diff --git a/_build/data/transport.core.menus.php b/_build/data/transport.core.menus.php index 1048e672c11..61d13413acb 100644 --- a/_build/data/transport.core.menus.php +++ b/_build/data/transport.core.menus.php @@ -121,7 +121,7 @@ [ 'text' => 'components', 'description' => '', - 'permissions' => 'components', + 'permissions' => 'menu_packages', 'action' => '', 'icon' => '', 'children' => [ diff --git a/core/lexicon/en/permissions.inc.php b/core/lexicon/en/permissions.inc.php index 6eeb7cd329a..21590b62767 100644 --- a/core/lexicon/en/permissions.inc.php +++ b/core/lexicon/en/permissions.inc.php @@ -13,7 +13,6 @@ $_lang['perm.change_profile_desc'] = 'User can change their profile.'; $_lang['perm.charsets_desc'] = 'To view a list of charsets.'; $_lang['perm.class_map_desc'] = 'To view a list of classes in the Class Map.'; -$_lang['perm.components_desc'] = 'To view the Extras menu.'; $_lang['perm.content_types_desc'] = 'The Content Types page.'; $_lang['perm.copy_desc'] = 'The ability to copy an object.'; $_lang['perm.countries_desc'] = 'To view a list of countries.'; @@ -84,6 +83,7 @@ $_lang['perm.mgr_log_view_desc'] = 'To view the manager action log.'; $_lang['perm.mgr_log_erase_desc'] = 'To clear the manager action log.'; $_lang['perm.menu_content_desc'] = 'Show the main menu item "Content".'; +$_lang['perm.menu_packages_desc'] = 'Show the main menu item "Extras".'; $_lang['perm.menu_reports_desc'] = 'Show the main menu item "Reports".'; $_lang['perm.menu_system_desc'] = 'Show the main menu item "System".'; $_lang['perm.menu_tools_desc'] = 'Show the main menu item "Tools".'; diff --git a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php index d3d0a0e66ef..6cf3522c688 100644 --- a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php +++ b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php @@ -25,6 +25,12 @@ 'menu_text' => '', 'menu_only' => false, ], + 'components' => [ + 'name' => 'menu_packages', + 'description' => 'perm.menu_packages_desc', + 'menu_text' => 'components', + 'menu_only' => false, + ], ]; // Remove permissions From bcaf4309a22964fcef83f69860b6a8541382ae57 Mon Sep 17 00:00:00 2001 From: Ruslan-Aleev Date: Fri, 26 Jul 2024 18:10:04 +0400 Subject: [PATCH 5/8] Update permission for Settings menu (cog icon) --- _build/data/transport.core.menus.php | 2 +- .../common/3.1.0-policy-permissions-menu-update.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/_build/data/transport.core.menus.php b/_build/data/transport.core.menus.php index 61d13413acb..ffce6d596d6 100644 --- a/_build/data/transport.core.menus.php +++ b/_build/data/transport.core.menus.php @@ -260,7 +260,7 @@ [ 'text' => 'admin', 'description' => '', - 'permissions' => 'settings', + 'permissions' => 'menu_system', 'action' => '', 'icon' => '', 'children' => [ diff --git a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php index 6cf3522c688..5585c4c5b15 100644 --- a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php +++ b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php @@ -31,6 +31,12 @@ 'menu_text' => 'components', 'menu_only' => false, ], + 'settings' => [ + 'name' => 'menu_system', + 'description' => 'perm.menu_system_desc', + 'menu_text' => 'admin', + 'menu_only' => true, + ], ]; // Remove permissions From 7147a3f65b30abd5a9782d27e9c741af85d2a7a2 Mon Sep 17 00:00:00 2001 From: Ruslan-Aleev Date: Fri, 26 Jul 2024 18:35:33 +0400 Subject: [PATCH 6/8] Update permission for Media menu --- .../data/permissions/transport.policy.tpl.administrator.php | 5 +++++ _build/data/transport.core.accesspolicies.php | 4 ++-- _build/data/transport.core.menus.php | 2 +- core/lexicon/en/permissions.inc.php | 1 + .../common/3.1.0-policy-permissions-menu-update.php | 6 ++++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/_build/data/permissions/transport.policy.tpl.administrator.php b/_build/data/permissions/transport.policy.tpl.administrator.php index b2d12e565c6..30905f3b8bb 100644 --- a/_build/data/permissions/transport.policy.tpl.administrator.php +++ b/_build/data/permissions/transport.policy.tpl.administrator.php @@ -380,6 +380,11 @@ 'description' => 'perm.menu_content_desc', 'value' => true, ]); +$permissions[] = $xpdo->newObject(modAccessPermission::class, [ + 'name' => 'menu_media', + 'description' => 'perm.menu_media_desc', + 'value' => true, +]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'menu_packages', 'description' => 'perm.menu_packages_desc', diff --git a/_build/data/transport.core.accesspolicies.php b/_build/data/transport.core.accesspolicies.php index b3b0f3755f3..09d3e9fdd7d 100644 --- a/_build/data/transport.core.accesspolicies.php +++ b/_build/data/transport.core.accesspolicies.php @@ -23,7 +23,7 @@ function jsonifyPermissions(array $permissions = []) { $corePermissions = [ modAccessPolicy::POLICY_RESOURCE => ['add_children', 'create', 'copy', 'delete', 'list', 'load', 'move', 'publish', 'remove', 'save', 'steal_lock', 'undelete', 'unpublish', 'view'], - modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_packages', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'trash_view', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_media', 'menu_packages', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'trash_view', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_LOAD_ONLY => ['load'], modAccessPolicy::POLICY_LOAD_LIST_VIEW => ['load', 'list', 'view'], modAccessPolicy::POLICY_OBJECT => ['load', 'list', 'view', 'save', 'remove'], @@ -31,7 +31,7 @@ function jsonifyPermissions(array $permissions = []) { modAccessPolicy::POLICY_CONTENT_EDITOR => ['change_profile', 'class_map', 'countries', 'delete_document', 'delete_static_resource', 'delete_symlink', 'delete_weblink', 'edit_document', 'edit_static_resource', 'edit_symlink', 'edit_weblink', 'frames', 'help', 'home', 'language', 'list', 'load', 'logout', 'menu_content', 'menu_reports', 'menu_tools', 'menu_user', 'new_document', 'new_static_resource', 'new_symlink', 'new_weblink', 'resource_duplicate', 'resource_tree', 'save_document', 'source_view', 'tree_show_resource_ids', 'view', 'view_document', 'view_template'], modAccessPolicy::POLICY_MEDIA_SOURCE_ADMIN => ['create', 'copy', 'load', 'list', 'save', 'remove', 'view'], modAccessPolicy::POLICY_MEDIA_SOURCE_USER => ['load', 'list', 'view'], - modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_packages', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_media', 'menu_packages', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_CONTEXT => ['load', 'list', 'view', 'save', 'remove', 'copy', 'view_unpublished'], modAccessPolicy::POLICY_HIDDEN_NAMESPACE => ['load' => false, 'list' => false, 'view' => true], ]; diff --git a/_build/data/transport.core.menus.php b/_build/data/transport.core.menus.php index ffce6d596d6..0d3cd60dca9 100644 --- a/_build/data/transport.core.menus.php +++ b/_build/data/transport.core.menus.php @@ -94,7 +94,7 @@ [ 'text' => 'media', 'description' => '', - 'permissions' => 'file_manager', + 'permissions' => 'menu_media', 'action' => '', 'icon' => '', 'children' => [ diff --git a/core/lexicon/en/permissions.inc.php b/core/lexicon/en/permissions.inc.php index 21590b62767..1c523d873ba 100644 --- a/core/lexicon/en/permissions.inc.php +++ b/core/lexicon/en/permissions.inc.php @@ -83,6 +83,7 @@ $_lang['perm.mgr_log_view_desc'] = 'To view the manager action log.'; $_lang['perm.mgr_log_erase_desc'] = 'To clear the manager action log.'; $_lang['perm.menu_content_desc'] = 'Show the main menu item "Content".'; +$_lang['perm.menu_media_desc'] = 'Show the main menu item "Media".'; $_lang['perm.menu_packages_desc'] = 'Show the main menu item "Extras".'; $_lang['perm.menu_reports_desc'] = 'Show the main menu item "Reports".'; $_lang['perm.menu_system_desc'] = 'Show the main menu item "System".'; diff --git a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php index 5585c4c5b15..e5ea69f741a 100644 --- a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php +++ b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php @@ -37,6 +37,12 @@ 'menu_text' => 'admin', 'menu_only' => true, ], + 'file_manager' => [ + 'name' => 'menu_media', + 'description' => 'perm.menu_media_desc', + 'menu_text' => 'media', + 'menu_only' => true, + ], ]; // Remove permissions From a8eaf7dc11ce53f2030fc4a6fe935920e2550781 Mon Sep 17 00:00:00 2001 From: Ruslan-Aleev Date: Sun, 28 Jul 2024 21:43:08 +0400 Subject: [PATCH 7/8] Remove 'menu_tools' permission --- .../data/permissions/transport.policy.tpl.administrator.php | 5 ----- _build/data/transport.core.accesspolicies.php | 6 +++--- core/lexicon/en/permissions.inc.php | 1 - .../common/3.1.0-policy-permissions-menu-update.php | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/_build/data/permissions/transport.policy.tpl.administrator.php b/_build/data/permissions/transport.policy.tpl.administrator.php index 30905f3b8bb..0324a7d708d 100644 --- a/_build/data/permissions/transport.policy.tpl.administrator.php +++ b/_build/data/permissions/transport.policy.tpl.administrator.php @@ -400,11 +400,6 @@ 'description' => 'perm.menu_system_desc', 'value' => true, ]); -$permissions[] = $xpdo->newObject(modAccessPermission::class, [ - 'name' => 'menu_tools', - 'description' => 'perm.menu_tools_desc', - 'value' => true, -]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'menu_user', 'description' => 'perm.menu_user_desc', diff --git a/_build/data/transport.core.accesspolicies.php b/_build/data/transport.core.accesspolicies.php index 09d3e9fdd7d..3d9673786f2 100644 --- a/_build/data/transport.core.accesspolicies.php +++ b/_build/data/transport.core.accesspolicies.php @@ -23,15 +23,15 @@ function jsonifyPermissions(array $permissions = []) { $corePermissions = [ modAccessPolicy::POLICY_RESOURCE => ['add_children', 'create', 'copy', 'delete', 'list', 'load', 'move', 'publish', 'remove', 'save', 'steal_lock', 'undelete', 'unpublish', 'view'], - modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_media', 'menu_packages', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'trash_view', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_media', 'menu_packages', 'menu_reports', 'menu_system', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'trash_view', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_LOAD_ONLY => ['load'], modAccessPolicy::POLICY_LOAD_LIST_VIEW => ['load', 'list', 'view'], modAccessPolicy::POLICY_OBJECT => ['load', 'list', 'view', 'save', 'remove'], modAccessPolicy::POLICY_ELEMENT => ['add_children', 'create', 'delete', 'list', 'load', 'remove', 'save', 'view', 'copy'], - modAccessPolicy::POLICY_CONTENT_EDITOR => ['change_profile', 'class_map', 'countries', 'delete_document', 'delete_static_resource', 'delete_symlink', 'delete_weblink', 'edit_document', 'edit_static_resource', 'edit_symlink', 'edit_weblink', 'frames', 'help', 'home', 'language', 'list', 'load', 'logout', 'menu_content', 'menu_reports', 'menu_tools', 'menu_user', 'new_document', 'new_static_resource', 'new_symlink', 'new_weblink', 'resource_duplicate', 'resource_tree', 'save_document', 'source_view', 'tree_show_resource_ids', 'view', 'view_document', 'view_template'], + modAccessPolicy::POLICY_CONTENT_EDITOR => ['change_profile', 'class_map', 'countries', 'delete_document', 'delete_static_resource', 'delete_symlink', 'delete_weblink', 'edit_document', 'edit_static_resource', 'edit_symlink', 'edit_weblink', 'frames', 'help', 'home', 'language', 'list', 'load', 'logout', 'menu_content', 'menu_reports', 'menu_user', 'new_document', 'new_static_resource', 'new_symlink', 'new_weblink', 'resource_duplicate', 'resource_tree', 'save_document', 'source_view', 'tree_show_resource_ids', 'view', 'view_document', 'view_template'], modAccessPolicy::POLICY_MEDIA_SOURCE_ADMIN => ['create', 'copy', 'load', 'list', 'save', 'remove', 'view'], modAccessPolicy::POLICY_MEDIA_SOURCE_USER => ['load', 'list', 'view'], - modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_media', 'menu_packages', 'menu_reports', 'menu_system', 'menu_tools', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_media', 'menu_packages', 'menu_reports', 'menu_system', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_CONTEXT => ['load', 'list', 'view', 'save', 'remove', 'copy', 'view_unpublished'], modAccessPolicy::POLICY_HIDDEN_NAMESPACE => ['load' => false, 'list' => false, 'view' => true], ]; diff --git a/core/lexicon/en/permissions.inc.php b/core/lexicon/en/permissions.inc.php index 1c523d873ba..e516f5b5256 100644 --- a/core/lexicon/en/permissions.inc.php +++ b/core/lexicon/en/permissions.inc.php @@ -87,7 +87,6 @@ $_lang['perm.menu_packages_desc'] = 'Show the main menu item "Extras".'; $_lang['perm.menu_reports_desc'] = 'Show the main menu item "Reports".'; $_lang['perm.menu_system_desc'] = 'Show the main menu item "System".'; -$_lang['perm.menu_tools_desc'] = 'Show the main menu item "Tools".'; $_lang['perm.menu_user_desc'] = 'Show the main menu item "User".'; $_lang['perm.menus_desc'] = 'To edit or save any main Menu items.'; $_lang['perm.messages_desc'] = 'To send or view any personal Messages.'; diff --git a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php index e5ea69f741a..1c57d61b852 100644 --- a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php +++ b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php @@ -11,7 +11,7 @@ use MODX\Revolution\modMenu; $defaultAaccessPolicyTemplateIds = [1, 2, 3, 4, 5, 6, 7]; -$permissionsRemove = ['about', 'credits', 'export_static', 'menu_security', 'menu_support']; +$permissionsRemove = ['about', 'credits', 'export_static', 'menu_security', 'menu_support', 'menu_tools']; $permissionsUpdate = [ 'menu_site' => [ 'name' => 'menu_content', From 39b214acd6e179eafa8659cb6bae2060fc799d9e Mon Sep 17 00:00:00 2001 From: Ruslan-Aleev Date: Tue, 8 Oct 2024 14:55:01 +0400 Subject: [PATCH 8/8] Update permission for Access menu --- .../data/permissions/transport.policy.tpl.administrator.php | 5 +++++ _build/data/transport.core.accesspolicies.php | 4 ++-- _build/data/transport.core.menus.php | 2 +- core/lexicon/en/permissions.inc.php | 1 + .../common/3.1.0-policy-permissions-menu-update.php | 6 ++++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/_build/data/permissions/transport.policy.tpl.administrator.php b/_build/data/permissions/transport.policy.tpl.administrator.php index 0324a7d708d..705b079397a 100644 --- a/_build/data/permissions/transport.policy.tpl.administrator.php +++ b/_build/data/permissions/transport.policy.tpl.administrator.php @@ -375,6 +375,11 @@ 'description' => 'perm.mgr_log_erase_desc', 'value' => true, ]); +$permissions[] = $xpdo->newObject(modAccessPermission::class, [ + 'name' => 'menu_access', + 'description' => 'perm.menu_access_desc', + 'value' => true, +]); $permissions[] = $xpdo->newObject(modAccessPermission::class, [ 'name' => 'menu_content', 'description' => 'perm.menu_content_desc', diff --git a/_build/data/transport.core.accesspolicies.php b/_build/data/transport.core.accesspolicies.php index 3d9673786f2..22213792293 100644 --- a/_build/data/transport.core.accesspolicies.php +++ b/_build/data/transport.core.accesspolicies.php @@ -23,7 +23,7 @@ function jsonifyPermissions(array $permissions = []) { $corePermissions = [ modAccessPolicy::POLICY_RESOURCE => ['add_children', 'create', 'copy', 'delete', 'list', 'load', 'move', 'publish', 'remove', 'save', 'steal_lock', 'undelete', 'unpublish', 'view'], - modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_media', 'menu_packages', 'menu_reports', 'menu_system', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'trash_view', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_ADMINISTRATOR => ['access_permissions', 'actions', 'change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'database_truncate', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_static_resource', 'delete_symlink', 'delete_template', 'delete_tv', 'delete_user', 'delete_weblink', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'events', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'flush_sessions', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_access', 'menu_content', 'menu_media', 'menu_packages', 'menu_reports', 'menu_system', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'policy_delete', 'policy_edit', 'policy_new', 'policy_save', 'policy_template_delete', 'policy_template_edit', 'policy_template_new', 'policy_template_save', 'policy_template_view', 'policy_view', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'remove_locks', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'resourcegroup_delete', 'resourcegroup_edit', 'resourcegroup_new', 'resourcegroup_resource_edit', 'resourcegroup_resource_list', 'resourcegroup_save', 'resourcegroup_view', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_role', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'set_sudo', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'steal_locks', 'trash_view', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'usergroup_delete', 'usergroup_edit', 'usergroup_new', 'usergroup_save', 'usergroup_user_edit', 'usergroup_user_list', 'usergroup_view', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_LOAD_ONLY => ['load'], modAccessPolicy::POLICY_LOAD_LIST_VIEW => ['load', 'list', 'view'], modAccessPolicy::POLICY_OBJECT => ['load', 'list', 'view', 'save', 'remove'], @@ -31,7 +31,7 @@ function jsonifyPermissions(array $permissions = []) { modAccessPolicy::POLICY_CONTENT_EDITOR => ['change_profile', 'class_map', 'countries', 'delete_document', 'delete_static_resource', 'delete_symlink', 'delete_weblink', 'edit_document', 'edit_static_resource', 'edit_symlink', 'edit_weblink', 'frames', 'help', 'home', 'language', 'list', 'load', 'logout', 'menu_content', 'menu_reports', 'menu_user', 'new_document', 'new_static_resource', 'new_symlink', 'new_weblink', 'resource_duplicate', 'resource_tree', 'save_document', 'source_view', 'tree_show_resource_ids', 'view', 'view_document', 'view_template'], modAccessPolicy::POLICY_MEDIA_SOURCE_ADMIN => ['create', 'copy', 'load', 'list', 'save', 'remove', 'view'], modAccessPolicy::POLICY_MEDIA_SOURCE_USER => ['load', 'list', 'view'], - modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_content', 'menu_media', 'menu_packages', 'menu_reports', 'menu_system', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], + modAccessPolicy::POLICY_DEVELOPER => ['change_password', 'change_profile', 'charsets', 'class_map', 'content_types', 'countries', 'create', 'customize_forms', 'dashboards', 'database', 'delete_category', 'delete_chunk', 'delete_context', 'delete_document', 'delete_eventlog', 'delete_plugin', 'delete_propertyset', 'delete_role', 'delete_snippet', 'delete_template', 'delete_tv', 'delete_user', 'directory_chmod', 'directory_create', 'directory_list', 'directory_remove', 'directory_update', 'edit_category', 'edit_chunk', 'edit_context', 'edit_document', 'edit_locked', 'edit_plugin', 'edit_propertyset', 'edit_role', 'edit_snippet', 'edit_static_resource', 'edit_symlink', 'edit_template', 'edit_tv', 'edit_user', 'edit_weblink', 'element_tree', 'empty_cache', 'error_log_erase', 'error_log_view', 'file_create', 'file_list', 'file_manager', 'file_remove', 'file_tree', 'file_unpack', 'file_update', 'file_upload', 'file_view', 'frames', 'help', 'home', 'language', 'languages', 'lexicons', 'list', 'load', 'logout', 'mgr_log_view', 'mgr_log_erase', 'menu_access', 'menu_content', 'menu_media', 'menu_packages', 'menu_reports', 'menu_system', 'menu_user', 'menus', 'messages', 'namespaces', 'new_category', 'new_chunk', 'new_context', 'new_document', 'new_document_in_root', 'new_plugin', 'new_propertyset', 'new_role', 'new_snippet', 'new_static_resource', 'new_symlink', 'new_template', 'new_tv', 'new_user', 'new_weblink', 'packages', 'property_sets', 'providers', 'publish_document', 'purge_deleted', 'remove', 'resource_duplicate', 'resource_quick_create', 'resource_quick_update', 'resource_tree', 'save', 'save_category', 'save_chunk', 'save_context', 'save_document', 'save_plugin', 'save_propertyset', 'save_snippet', 'save_template', 'save_tv', 'save_user', 'search', 'settings', 'source_delete', 'source_edit', 'source_save', 'source_view', 'sources', 'tree_show_element_ids', 'tree_show_resource_ids', 'undelete_document', 'unlock_element_properties', 'unpublish_document', 'view', 'view_category', 'view_chunk', 'view_context', 'view_document', 'view_element', 'view_eventlog', 'view_offline', 'view_plugin', 'view_propertyset', 'view_role', 'view_snippet', 'view_sysinfo', 'view_template', 'view_tv', 'view_unpublished', 'view_user', 'workspaces'], modAccessPolicy::POLICY_CONTEXT => ['load', 'list', 'view', 'save', 'remove', 'copy', 'view_unpublished'], modAccessPolicy::POLICY_HIDDEN_NAMESPACE => ['load' => false, 'list' => false, 'view' => true], ]; diff --git a/_build/data/transport.core.menus.php b/_build/data/transport.core.menus.php index 0d3cd60dca9..f935e6ef942 100644 --- a/_build/data/transport.core.menus.php +++ b/_build/data/transport.core.menus.php @@ -186,7 +186,7 @@ [ 'text' => 'access', 'description' => '', - 'permissions' => 'access_permissions', + 'permissions' => 'menu_access', 'action' => '', 'icon' => '', 'children' => [ diff --git a/core/lexicon/en/permissions.inc.php b/core/lexicon/en/permissions.inc.php index e516f5b5256..14fac9f7d4e 100644 --- a/core/lexicon/en/permissions.inc.php +++ b/core/lexicon/en/permissions.inc.php @@ -82,6 +82,7 @@ $_lang['perm.logout_desc'] = 'To be able to logout as a user.'; $_lang['perm.mgr_log_view_desc'] = 'To view the manager action log.'; $_lang['perm.mgr_log_erase_desc'] = 'To clear the manager action log.'; +$_lang['perm.menu_access_desc'] = 'Show the main menu item "Access".'; $_lang['perm.menu_content_desc'] = 'Show the main menu item "Content".'; $_lang['perm.menu_media_desc'] = 'Show the main menu item "Media".'; $_lang['perm.menu_packages_desc'] = 'Show the main menu item "Extras".'; diff --git a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php index 1c57d61b852..2e8af674615 100644 --- a/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php +++ b/setup/includes/upgrades/common/3.1.0-policy-permissions-menu-update.php @@ -43,6 +43,12 @@ 'menu_text' => 'media', 'menu_only' => true, ], + 'access_permissions' => [ + 'name' => 'menu_access', + 'description' => 'perm.menu_access_desc', + 'menu_text' => 'access', + 'menu_only' => true, + ], ]; // Remove permissions