From 63ed53572aacd9b3d50bfc65148b96695c50f99f Mon Sep 17 00:00:00 2001 From: Kristiaan Van den Eynde Date: Fri, 4 Aug 2017 15:53:27 +0200 Subject: [PATCH] interdiff --- core/lib/Drupal/Core/Session/PermissionsHashGenerator.php | 6 +++--- core/modules/user/src/Tests/UserPermissionsTest.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/lib/Drupal/Core/Session/PermissionsHashGenerator.php b/core/lib/Drupal/Core/Session/PermissionsHashGenerator.php index ab87cf9..60e40ab 100644 --- a/core/lib/Drupal/Core/Session/PermissionsHashGenerator.php +++ b/core/lib/Drupal/Core/Session/PermissionsHashGenerator.php @@ -66,13 +66,13 @@ public function __construct(PrivateKey $private_key, CacheBackendInterface $cach * Cached by role, invalidated whenever permissions change. */ public function generate(AccountInterface $account) { - // Admin roles can always access all permissions. Use a different, unique - // identifier for the hash. + // Admin roles have all permissions implicitly assigned. Use a different, + // unique identifier for the hash. $storage = $this->entityTypeManager->getStorage('user_role'); foreach ($storage->loadMultiple($account->getRoles()) as $role) { /** @var \Drupal\user\RoleInterface $role */ if ($role->isAdmin()) { - return $this->hash('is-super-user'); + return $this->hash('is-admin'); } } diff --git a/core/modules/user/src/Tests/UserPermissionsTest.php b/core/modules/user/src/Tests/UserPermissionsTest.php index c600de5..10044e8 100644 --- a/core/modules/user/src/Tests/UserPermissionsTest.php +++ b/core/modules/user/src/Tests/UserPermissionsTest.php @@ -93,7 +93,7 @@ public function testAdministratorRole() { $this->drupalGet('admin/config/people/accounts'); // Verify that the administration role is 'administrator' by default. - $this->assertOptionSelected('edit-user-admin-role', 'administrator', 'Administration role defaults to none.'); + $this->assertOptionSelected('edit-user-admin-role', RoleInterface::ADMINISTRATOR_ID, 'Administration role defaults to none.'); $this->assertFalse(Role::load($this->rid)->isAdmin()); -- 2.8.1