diff --git a/core/lib/Drupal/Core/Session/UserSession.php b/core/lib/Drupal/Core/Session/UserSession.php index 99a003a..3e56551 100644 --- a/core/lib/Drupal/Core/Session/UserSession.php +++ b/core/lib/Drupal/Core/Session/UserSession.php @@ -121,7 +121,7 @@ public function hasPermission($permission) { return TRUE; } - $roles = \Drupal::entityManager()->getStorageController('user_role')->load($this->getRoles()); + $roles = \Drupal::entityManager()->getStorageController('user_role')->loadMultiple($this->getRoles()); foreach ($roles as $role) { if ($role->hasPermission($permission)) { diff --git a/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php b/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php index 22cb9a3..fbe95c6 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php +++ b/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php @@ -224,7 +224,7 @@ public function hasPermission($permission) { return TRUE; } - $roles = \Drupal::entityManager()->getStorageController('user_role')->load($this->getRoles()); + $roles = \Drupal::entityManager()->getStorageController('user_role')->loadMultiple($this->getRoles()); foreach ($roles as $role) { if ($role->hasPermission($permission)) { diff --git a/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php b/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php index 0ce1224..1c26b56 100644 --- a/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php +++ b/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php @@ -93,10 +93,10 @@ protected function setUp() { $role_storage = $this->getMockBuilder('Drupal\user\RoleStorageController') ->disableOriginalConstructor() - ->setMethods(array('load')) + ->setMethods(array('loadMultiple')) ->getMock(); $role_storage->expects($this->any()) - ->method('load') + ->method('loadMultiple') ->will($this->returnValueMap(array( array(array(), array()), array(NULL, $roles),