diff --git a/core/modules/book/tests/src/Functional/BookTest.php b/core/modules/book/tests/src/Functional/BookTest.php index 66edec9..f8091a6 100644 --- a/core/modules/book/tests/src/Functional/BookTest.php +++ b/core/modules/book/tests/src/Functional/BookTest.php @@ -427,7 +427,7 @@ public function testBookNavigationBlock() { // Give anonymous users the permission 'node test view'. $edit = []; $edit[RoleInterface::ANONYMOUS_ID . '[node test view]'] = TRUE; - $this->drupalPostForm('admin/people/permissions/' . RoleInterface::ANONYMOUS_ID, $edit, t('Save permissions')); + $this->drupalPostForm('admin/config/people/permissions/' . RoleInterface::ANONYMOUS_ID, $edit, t('Save permissions')); $this->assertText(t('The changes have been saved.'), "Permission 'node test view' successfully assigned to anonymous users."); // Test correct display of the block. @@ -502,7 +502,7 @@ public function testNavigationBlockOnAccessModuleInstalled() { // Give anonymous users the permission 'node test view'. $edit = []; $edit[RoleInterface::ANONYMOUS_ID . '[node test view]'] = TRUE; - $this->drupalPostForm('admin/people/permissions/' . RoleInterface::ANONYMOUS_ID, $edit, t('Save permissions')); + $this->drupalPostForm('admin/config/people/permissions/' . RoleInterface::ANONYMOUS_ID, $edit, t('Save permissions')); $this->assertText(t('The changes have been saved.'), "Permission 'node test view' successfully assigned to anonymous users."); // Create a book. diff --git a/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php b/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php index 7482935..b50678f 100644 --- a/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php +++ b/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php @@ -33,7 +33,7 @@ public function testDraggableList() { } // Navigate to Roles page - $this->drupalGet('admin/people/roles'); + $this->drupalGet('admin/config/people/roles'); // Test for the page title. $this->assertSession()->titleEquals(t('Roles') . ' | Drupal'); diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php index 586d197..edbed3e 100644 --- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php +++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php @@ -310,9 +310,9 @@ public function doUserRoleListTest() { $this->drupalCreateRole([], $role_id); // Get the role listing. - $this->drupalGet('admin/people/roles'); + $this->drupalGet('admin/config/people/roles'); - $translate_link = 'admin/people/roles/manage/' . $role_id . '/translate'; + $translate_link = 'admin/config/people/roles/manage/' . $role_id . '/translate'; // Test if the link to translate the role is on the page. $this->assertLinkByHref($translate_link); diff --git a/core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php b/core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php index 479a600..83d7f79 100644 --- a/core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php +++ b/core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php @@ -45,7 +45,7 @@ public function testConfigTranslationImport() { $edit = [ 'authenticated[translate interface]' => 'translate interface', ]; - $this->drupalPostForm('admin/people/permissions', $edit, t('Save permissions')); + $this->drupalPostForm('admin/config/people/permissions', $edit, t('Save permissions')); // Check and update the translation status. This will import the Afrikaans // translations of locale_test_translate module. diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php index dde9502..d93c15e 100644 --- a/core/modules/menu_ui/src/Tests/MenuTest.php +++ b/core/modules/menu_ui/src/Tests/MenuTest.php @@ -636,7 +636,7 @@ public function addMenuLink($parent = '', $path = '/', $menu_name = 'tools', $ex * Attempts to add menu link with invalid path or no access permission. */ public function addInvalidMenuLink() { - foreach (['access' => '/admin/people/permissions'] as $type => $link_path) { + foreach (['access' => '/admin/config/people/permissions'] as $type => $link_path) { $edit = [ 'link[0][uri]' => $link_path, 'title[0][value]' => 'title', diff --git a/core/modules/node/src/Tests/NodeViewTest.php b/core/modules/node/src/Tests/NodeViewTest.php index a01cb25..97f9f82 100644 --- a/core/modules/node/src/Tests/NodeViewTest.php +++ b/core/modules/node/src/Tests/NodeViewTest.php @@ -49,7 +49,7 @@ public function testHtmlHeadLinks() { $edit = [ 'anonymous[edit own ' . $node->bundle() . ' content]' => TRUE ]; - $this->drupalPostForm('admin/people/permissions', $edit, 'Save permissions'); + $this->drupalPostForm('admin/config/people/permissions', $edit, 'Save permissions'); $this->drupalLogout(); // Anonymous user's should now see the edit-form link but not the diff --git a/core/modules/search/src/Tests/SearchCommentTest.php b/core/modules/search/src/Tests/SearchCommentTest.php index 7047429..09bf32c 100644 --- a/core/modules/search/src/Tests/SearchCommentTest.php +++ b/core/modules/search/src/Tests/SearchCommentTest.php @@ -110,7 +110,7 @@ public function testSearchResultsComment() { RoleInterface::ANONYMOUS_ID . '[access comments]' => 1, RoleInterface::ANONYMOUS_ID . '[post comments]' => 1, ]; - $this->drupalPostForm('admin/people/permissions', $edit, t('Save permissions')); + $this->drupalPostForm('admin/config/people/permissions', $edit, t('Save permissions')); // Create a node. $node = $this->drupalCreateNode(['type' => 'article']); diff --git a/core/modules/system/src/Tests/System/AdminTest.php b/core/modules/system/src/Tests/System/AdminTest.php index 7921e1c..6277c1c 100644 --- a/core/modules/system/src/Tests/System/AdminTest.php +++ b/core/modules/system/src/Tests/System/AdminTest.php @@ -91,7 +91,7 @@ public function testAdminPages() { // On admin/index only, the administrator should also see a "Configure // permissions" link for the Locale module. if ($page == 'admin/index') { - $this->assertLinkByHref("admin/people/permissions#module-locale"); + $this->assertLinkByHref("admin/config/people/permissions#module-locale"); } // For a less privileged user, verify that there are no links to Locale's diff --git a/core/modules/system/tests/modules/entity_test/entity_test.routing.yml b/core/modules/system/tests/modules/entity_test/entity_test.routing.yml index 5b6d37b..bed53eb 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.routing.yml +++ b/core/modules/system/tests/modules/entity_test/entity_test.routing.yml @@ -89,7 +89,7 @@ entity.block.test_operation: _access: 'TRUE' entity.user_role.test_operation: - path: '/admin/people/roles/manage/{user_role}/test_operation' + path: '/admin/config/people/roles/manage/{user_role}/test_operation' defaults: _entity_view: 'entity_test' requirements: diff --git a/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php b/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php index b020f42..903f90e 100644 --- a/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php +++ b/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php @@ -32,7 +32,7 @@ protected function setUp() { */ public function testEntityOperationAlter() { // Check that role listing contain our test_operation operation. - $this->drupalGet('admin/people/roles'); + $this->drupalGet('admin/config/people/roles'); $roles = user_roles(); foreach ($roles as $role) { $this->assertLinkByHref($role->url() . '/test_operation'); diff --git a/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php index dc63e64..8a1e0fb 100644 --- a/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php +++ b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php @@ -40,7 +40,7 @@ public function testModuleListForm() { $this->assertFieldByXPath("//a[contains(@href, '/system-test/configure/bar') and text()='Configure ']/span[contains(@class, 'visually-hidden') and text()='the System test module']"); // Check that system_test's permissions link was rendered correctly. - $this->assertFieldByXPath("//a[contains(@href, '/admin/people/permissions#module-system_test') and @title='Configure permissions']"); + $this->assertFieldByXPath("//a[contains(@href, '/admin/config/people/permissions#module-system_test') and @title='Configure permissions']"); // Check that system_test's help link was rendered correctly. $this->assertFieldByXPath("//a[contains(@href, '/admin/help/system_test') and @title='Help']"); diff --git a/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php b/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php index dd4b5c4..df8deb0 100644 --- a/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php +++ b/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php @@ -152,7 +152,7 @@ public function testUserRoleUpdateSubtreesHashCacheClear() { $edit = []; $edit[$rid . '[administer taxonomy]'] = FALSE; - $this->drupalPostForm('admin/people/permissions', $edit, t('Save permissions')); + $this->drupalPostForm('admin/config/people/permissions', $edit, t('Save permissions')); // Assert that the subtrees hash has been altered because the subtrees // structure changed. diff --git a/core/modules/user/src/Entity/Role.php b/core/modules/user/src/Entity/Role.php index 0e7ef0e..cd2db32 100644 --- a/core/modules/user/src/Entity/Role.php +++ b/core/modules/user/src/Entity/Role.php @@ -30,10 +30,10 @@ * "label" = "label" * }, * links = { - * "delete-form" = "/admin/people/roles/manage/{user_role}/delete", - * "edit-form" = "/admin/people/roles/manage/{user_role}", - * "edit-permissions-form" = "/admin/people/permissions/{user_role}", - * "collection" = "/admin/people/roles", + * "delete-form" = "/admin/config/people/roles/manage/{user_role}/delete", + * "edit-form" = "/admin/config/people/roles/manage/{user_role}", + * "edit-permissions-form" = "/admin/config/people/permissions/{user_role}", + * "collection" = "/admin/config/people/roles", * }, * config_export = { * "id", diff --git a/core/modules/user/src/Tests/UserBlocksTest.php b/core/modules/user/src/Tests/UserBlocksTest.php index 1495b20..dffcc0f 100644 --- a/core/modules/user/src/Tests/UserBlocksTest.php +++ b/core/modules/user/src/Tests/UserBlocksTest.php @@ -69,7 +69,7 @@ public function testUserLoginBlock() { $edit = []; $edit['name'] = $user->getUsername(); $edit['pass'] = $user->pass_raw; - $this->drupalPostForm('admin/people/permissions', $edit, t('Log in')); + $this->drupalPostForm('admin/config/people/permissions', $edit, t('Log in')); $this->assertNoText(t('User login'), 'Logged in.'); // Check that we are still on the same page. diff --git a/core/modules/user/src/Tests/UserPermissionsTest.php b/core/modules/user/src/Tests/UserPermissionsTest.php index 4f9e260..3ff82a7 100644 --- a/core/modules/user/src/Tests/UserPermissionsTest.php +++ b/core/modules/user/src/Tests/UserPermissionsTest.php @@ -40,6 +40,19 @@ protected function setUp() { } /** + * Test acessing the Permissions administration page. + */ + public function testPermissionsAdministration() { + $this->drupalLogin($this->adminUser); + $default_langcode = \Drupal::languageManager() + ->getDefaultLanguage() + ->getId(); + + $this->drupalGet('admin/config/people/permissions'); + $this->assertTitle(t('Permissions' . ' | Drupal')); + } + + /** * Test changing user permissions through the permissions page. */ public function testUserPermissionChanges() { @@ -61,7 +74,7 @@ public function testUserPermissionChanges() { $this->assertFalse($account->hasPermission('administer users'), 'User does not have "administer users" permission.'); $edit = []; $edit[$rid . '[administer users]'] = TRUE; - $this->drupalPostForm('admin/people/permissions', $edit, t('Save permissions')); + $this->drupalPostForm('admin/config/people/permissions', $edit, t('Save permissions')); $this->assertText(t('The changes have been saved.'), 'Successful save message displayed.'); $storage->resetCache(); $this->assertTrue($account->hasPermission('administer users'), 'User now has "administer users" permission.'); @@ -74,7 +87,7 @@ public function testUserPermissionChanges() { $this->assertTrue($account->hasPermission('access user profiles'), 'User has "access user profiles" permission.'); $edit = []; $edit[$rid . '[access user profiles]'] = FALSE; - $this->drupalPostForm('admin/people/permissions', $edit, t('Save permissions')); + $this->drupalPostForm('admin/config/people/permissions', $edit, t('Save permissions')); $this->assertText(t('The changes have been saved.'), 'Successful save message displayed.'); $storage->resetCache(); $this->assertFalse($account->hasPermission('access user profiles'), 'User no longer has "access user profiles" permission.'); diff --git a/core/modules/user/src/Tests/UserRoleAdminTest.php b/core/modules/user/src/Tests/UserRoleAdminTest.php index eca9915..2377e77 100644 --- a/core/modules/user/src/Tests/UserRoleAdminTest.php +++ b/core/modules/user/src/Tests/UserRoleAdminTest.php @@ -42,20 +42,17 @@ protected function setUp() { public function testRoleAdministration() { $this->drupalLogin($this->adminUser); $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); - // Test presence of tab. - $this->drupalGet('admin/people/permissions'); - $tabs = $this->xpath('//ul[@class=:classes and //a[contains(., :text)]]', [ - ':classes' => 'tabs primary', - ':text' => t('Roles'), - ]); - $this->assertEqual(count($tabs), 1, 'Found roles tab'); + + // Test accessing the Roles administration page. + $this->drupalGet( 'admin/config/people/roles'); + $this->assertTitle(t('Roles' . ' | Drupal')); // Test adding a role. (In doing so, we use a role name that happens to // correspond to an integer, to test that the role administration pages // correctly distinguish between role names and IDs.) $role_name = '123'; $edit = ['label' => $role_name, 'id' => $role_name]; - $this->drupalPostForm('admin/people/roles/add', $edit, t('Save')); + $this->drupalPostForm('admin/config/people/roles/add', $edit, t('Save')); $this->assertRaw(t('Role %label has been added.', ['%label' => 123])); $role = Role::load($role_name); $this->assertTrue(is_object($role), 'The role was successfully retrieved from the database.'); @@ -64,33 +61,33 @@ public function testRoleAdministration() { $this->assertEqual($role->language()->getId(), $default_langcode); // Try adding a duplicate role. - $this->drupalPostForm('admin/people/roles/add', $edit, t('Save')); + $this->drupalPostForm('admin/config/people/roles/add', $edit, t('Save')); $this->assertRaw(t('The machine-readable name is already in use. It must be unique.'), 'Duplicate role warning displayed.'); // Test renaming a role. $role_name = '456'; $edit = ['label' => $role_name]; - $this->drupalPostForm("admin/people/roles/manage/{$role->id()}", $edit, t('Save')); + $this->drupalPostForm("admin/config/people/roles/manage/{$role->id()}", $edit, t('Save')); $this->assertRaw(t('Role %label has been updated.', ['%label' => $role_name])); \Drupal::entityManager()->getStorage('user_role')->resetCache([$role->id()]); $new_role = Role::load($role->id()); $this->assertEqual($new_role->label(), $role_name, 'The role name has been successfully changed.'); // Test deleting a role. - $this->drupalGet("admin/people/roles/manage/{$role->id()}"); + $this->drupalGet("admin/config/people/roles/manage/{$role->id()}"); $this->clickLink(t('Delete')); $this->drupalPostForm(NULL, [], t('Delete')); $this->assertRaw(t('The role %label has been deleted.', ['%label' => $role_name])); - $this->assertNoLinkByHref("admin/people/roles/manage/{$role->id()}", 'Role edit link removed.'); + $this->assertNoLinkByHref("admin/config/people/roles/manage/{$role->id()}", 'Role edit link removed.'); \Drupal::entityManager()->getStorage('user_role')->resetCache([$role->id()]); $this->assertFalse(Role::load($role->id()), 'A deleted role can no longer be loaded.'); // Make sure that the system-defined roles can be edited via the user // interface. - $this->drupalGet('admin/people/roles/manage/' . RoleInterface::ANONYMOUS_ID); + $this->drupalGet('admin/config/people/roles/manage/' . RoleInterface::ANONYMOUS_ID); $this->assertResponse(200, 'Access granted when trying to edit the built-in anonymous role.'); $this->assertNoText(t('Delete role'), 'Delete button for the anonymous role is not present.'); - $this->drupalGet('admin/people/roles/manage/' . RoleInterface::AUTHENTICATED_ID); + $this->drupalGet('admin/config/people/roles/manage/' . RoleInterface::AUTHENTICATED_ID); $this->assertResponse(200, 'Access granted when trying to edit the built-in authenticated role.'); $this->assertNoText(t('Delete role'), 'Delete button for the authenticated role is not present.'); } @@ -113,7 +110,7 @@ public function testRoleWeightOrdering() { $saved_rids[] = $role->id(); $weight--; } - $this->drupalPostForm('admin/people/roles', $edit, t('Save')); + $this->drupalPostForm('admin/config/people/roles', $edit, t('Save')); $this->assertText(t('The role settings have been updated.'), 'The role settings form submitted successfully.'); // Load up the user roles with the new weights. diff --git a/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php b/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php index b9986c9..769e138 100644 --- a/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php +++ b/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php @@ -30,9 +30,7 @@ public function testUserAdminLocalTasks($route, $expected) { */ public function getUserAdminRoutes() { return [ - ['entity.user.collection', [['entity.user.collection', 'user.admin_permissions', 'entity.user_role.collection']]], - ['user.admin_permissions', [['entity.user.collection', 'user.admin_permissions', 'entity.user_role.collection']]], - ['entity.user_role.collection', [['entity.user.collection', 'user.admin_permissions', 'entity.user_role.collection']]], + ['entity.user.collection', [['entity.user.collection']]], ['entity.user.admin_form', [['user.account_settings_tab']]], ]; } diff --git a/core/modules/user/user.links.menu.yml b/core/modules/user/user.links.menu.yml index bceb59b..12f1f0a 100644 --- a/core/modules/user/user.links.menu.yml +++ b/core/modules/user/user.links.menu.yml @@ -26,3 +26,16 @@ entity.user.admin_form: description: 'Configure default user account settings, including fields, registration requirements, and email messages.' weight: -10 route_name: entity.user.admin_form +user.admin_permissions: + title: 'Permissions' + parent: user.admin_index + description: 'Configure permissions per module and per role.' + weight: -9 + route_name: user.admin_permissions +entity.user_role.collection: + title: 'Roles' + parent: user.admin_index + description: 'Create roles and configure their permissions.' + weight: -8 + route_name: entity.user_role.collection + diff --git a/core/modules/user/user.links.task.yml b/core/modules/user/user.links.task.yml index 5b0d164..ce58387 100644 --- a/core/modules/user/user.links.task.yml +++ b/core/modules/user/user.links.task.yml @@ -38,14 +38,3 @@ entity.user.collection: title: List route_name: entity.user.collection base_route: entity.user.collection - -user.admin_permissions: - title: Permissions - route_name: user.admin_permissions - base_route: entity.user.collection - -entity.user_role.collection: - title: 'Roles' - route_name: entity.user_role.collection - base_route: entity.user.collection - weight: 10 diff --git a/core/modules/user/user.module b/core/modules/user/user.module index b865e95..9ea329e 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -87,6 +87,9 @@ function user_help($route_name, RouteMatchInterface $route_match) { case 'user.admin_create': return '

' . t("This web page allows administrators to register new users. Users' email addresses and usernames must be unique.") . '

'; + case 'entity.user.collection': + return '

' . t('For configuration of user accounts, permissions and roles check the People Configuration pages.', [':config-people' => \Drupal::url('user.admin_index')]) . '

'; + case 'user.admin_permissions': return '

' . t('Permissions let you control what users can do and see on your site. You can define a specific set of permissions for each role. (See the Roles page to create a role.) Any permissions granted to the Authenticated user role will be given to any user who is logged in to your site. From the Account settings page, you can make any role into an Administrator role for the site, meaning that role will be granted all new permissions automatically. You should be careful to ensure that only trusted users are given this access and level of control of your site.', [':role' => \Drupal::url('entity.user_role.collection'), ':settings' => \Drupal::url('entity.user.admin_form')]) . '

'; diff --git a/core/modules/user/user.routing.yml b/core/modules/user/user.routing.yml index 319f219..526d6df 100644 --- a/core/modules/user/user.routing.yml +++ b/core/modules/user/user.routing.yml @@ -46,7 +46,7 @@ user.admin_create: _permission: 'administer users' user.admin_permissions: - path: '/admin/people/permissions' + path: '/admin/config/people/permissions' defaults: _form: '\Drupal\user\Form\UserPermissionsForm' _title: 'Permissions' @@ -54,7 +54,7 @@ user.admin_permissions: _permission: 'administer permissions' entity.user_role.edit_permissions_form: - path: '/admin/people/permissions/{user_role}' + path: '/admin/config/people/permissions/{user_role}' defaults: _form: '\Drupal\user\Form\UserPermissionsRoleSpecificForm' _title: 'Edit role' @@ -70,7 +70,7 @@ user.multiple_cancel_confirm: _permission: 'administer users' entity.user_role.collection: - path: '/admin/people/roles' + path: '/admin/config/people/roles' defaults: _entity_list: 'user_role' _title: 'Roles' @@ -78,7 +78,7 @@ entity.user_role.collection: _permission: 'administer permissions' user.role_add: - path: '/admin/people/roles/add' + path: '/admin/config/people/roles/add' defaults: _entity_form: user_role.default _title: 'Add role' @@ -86,7 +86,7 @@ user.role_add: _permission: 'administer permissions' entity.user_role.edit_form: - path: '/admin/people/roles/manage/{user_role}' + path: '/admin/config/people/roles/manage/{user_role}' defaults: _entity_form: user_role.default _title: 'Edit role' @@ -94,7 +94,7 @@ entity.user_role.edit_form: _entity_access: user_role.update entity.user_role.delete_form: - path: '/admin/people/roles/manage/{user_role}/delete' + path: '/admin/config/people/roles/manage/{user_role}/delete' defaults: _entity_form: user_role.delete _title: 'Delete role' diff --git a/core/modules/views_ui/src/Tests/ViewEditTest.php b/core/modules/views_ui/src/Tests/ViewEditTest.php index 08c5cfe..c3aa0ad 100644 --- a/core/modules/views_ui/src/Tests/ViewEditTest.php +++ b/core/modules/views_ui/src/Tests/ViewEditTest.php @@ -172,7 +172,7 @@ public function testEditFormLanguageOptions() { $edit = [ 'authenticated[administer languages]' => TRUE, ]; - $this->drupalPostForm('/admin/people/permissions', $edit, t('Save permissions')); + $this->drupalPostForm('/admin/config/people/permissions', $edit, t('Save permissions')); // Enable Content language negotiation so we have one more item // to select. $edit = [