From eeb9c89893cbe530182b5736f9200e62fa338b69 Mon Sep 17 00:00:00 2001 From: Kristiaan Van den Eynde Date: Wed, 31 May 2017 11:05:31 +0200 Subject: [PATCH] interdiff --- core/modules/user/src/Tests/UserPermissionsTest.php | 4 ++-- core/modules/user/user.module | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/core/modules/user/src/Tests/UserPermissionsTest.php b/core/modules/user/src/Tests/UserPermissionsTest.php index d8d0bcd..c600de5 100644 --- a/core/modules/user/src/Tests/UserPermissionsTest.php +++ b/core/modules/user/src/Tests/UserPermissionsTest.php @@ -92,8 +92,8 @@ public function testAdministratorRole() { $this->drupalLogin($this->adminUser); $this->drupalGet('admin/config/people/accounts'); - // Verify that the administration role is none by default. - $this->assertOptionSelected('edit-user-admin-role', '', 'Administration role defaults to none.'); + // Verify that the administration role is 'administrator' by default. + $this->assertOptionSelected('edit-user-admin-role', 'administrator', 'Administration role defaults to none.'); $this->assertFalse(Role::load($this->rid)->isAdmin()); diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 961e9dd..d8c6b27 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -993,9 +993,8 @@ function user_role_names($membersonly = FALSE, $permission = NULL) { * Implements hook_ENTITY_TYPE_insert() for user_role entities. */ function user_user_role_insert(RoleInterface $role) { - // Ignore the authenticated, anonymous and superuser roles or when the role is - // being synced. - $internal = [RoleInterface::AUTHENTICATED_ID, RoleInterface::ANONYMOUS_ID, RoleInterface::ADMINISTRATOR_ID]; + // Ignore the authenticated and anonymous roles or when the role is being synced. + $internal = [RoleInterface::AUTHENTICATED_ID, RoleInterface::ANONYMOUS_ID]; if (in_array($role->id(), $internal) || $role->isSyncing()) { return; } @@ -1036,9 +1035,8 @@ function user_user_role_delete(RoleInterface $role) { $user_storage = \Drupal::entityManager()->getStorage('user'); $user_storage->deleteRoleReferences([$role->id()]); - // Ignore the authenticated, anonymous and superuser roles or when the role is - // being synced. - $internal = [RoleInterface::AUTHENTICATED_ID, RoleInterface::ANONYMOUS_ID, RoleInterface::ADMINISTRATOR_ID]; + // Ignore the authenticated and anonymous roles or when the role is being synced. + $internal = [RoleInterface::AUTHENTICATED_ID, RoleInterface::ANONYMOUS_ID]; if (in_array($role->id(), $internal) || $role->isSyncing()) { return; } -- 2.8.1