Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused / update menu permissions #16595

Open
wants to merge 8 commits into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 17 additions & 37 deletions _build/data/permissions/transport.policy.tpl.administrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -45,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',
Expand All @@ -65,11 +55,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',
Expand Down Expand Up @@ -285,11 +270,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',
Expand Down Expand Up @@ -396,38 +376,33 @@
'value' => true,
]);
$permissions[] = $xpdo->newObject(modAccessPermission::class, [
'name' => 'menu_reports',
'description' => 'perm.menu_reports_desc',
'value' => true,
]);
$permissions[] = $xpdo->newObject(modAccessPermission::class, [
'name' => 'menu_security',
'description' => 'perm.menu_security_desc',
'name' => 'menu_access',
'description' => 'perm.menu_access_desc',
'value' => true,
]);
$permissions[] = $xpdo->newObject(modAccessPermission::class, [
'name' => 'menu_site',
'description' => 'perm.menu_site_desc',
'name' => 'menu_content',
'description' => 'perm.menu_content_desc',
'value' => true,
]);
$permissions[] = $xpdo->newObject(modAccessPermission::class, [
'name' => 'menu_support',
'description' => 'perm.menu_support_desc',
'name' => 'menu_media',
'description' => 'perm.menu_media_desc',
'value' => true,
]);
$permissions[] = $xpdo->newObject(modAccessPermission::class, [
'name' => 'menu_system',
'description' => 'perm.menu_system_desc',
'name' => 'menu_packages',
'description' => 'perm.menu_packages_desc',
'value' => true,
]);
$permissions[] = $xpdo->newObject(modAccessPermission::class, [
'name' => 'menu_tools',
'description' => 'perm.menu_tools_desc',
'name' => 'menu_reports',
'description' => 'perm.menu_reports_desc',
'value' => true,
]);
$permissions[] = $xpdo->newObject(modAccessPermission::class, [
'name' => 'menu_trash',
'description' => 'perm.menu_trash_desc',
'name' => 'menu_system',
'description' => 'perm.menu_system_desc',
'value' => true,
]);
$permissions[] = $xpdo->newObject(modAccessPermission::class, [
Expand Down Expand Up @@ -775,6 +750,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',
Expand Down
6 changes: 3 additions & 3 deletions _build/data/transport.core.accesspolicies.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', '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'],
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_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 => ['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', '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],
];
Expand Down
10 changes: 5 additions & 5 deletions _build/data/transport.core.menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[
'text' => 'site',
'description' => '',
'permissions' => 'menu_site',
'permissions' => 'menu_content',
'action' => '',
'icon' => '<i class="icon-file-text-o icon"></i>',
'children' => [
Expand Down Expand Up @@ -94,7 +94,7 @@
[
'text' => 'media',
'description' => '',
'permissions' => 'file_manager',
'permissions' => 'menu_media',
'action' => '',
'icon' => '<i class="icon-file-image-o icon"></i>',
'children' => [
Expand All @@ -121,7 +121,7 @@
[
'text' => 'components',
'description' => '',
'permissions' => 'components',
'permissions' => 'menu_packages',
'action' => '',
'icon' => '<i class="icon-cube icon"></i>',
'children' => [
Expand Down Expand Up @@ -186,7 +186,7 @@
[
'text' => 'access',
'description' => '',
'permissions' => 'access_permissions',
'permissions' => 'menu_access',
'action' => '',
'icon' => '<i class="icon-user-lock icon"></i>',
'children' => [
Expand Down Expand Up @@ -260,7 +260,7 @@
[
'text' => 'admin',
'description' => '',
'permissions' => 'settings',
'permissions' => 'menu_system',
'action' => '',
'icon' => '<i class="icon-gear icon"></i>',
'children' => [
Expand Down
Loading
Loading