Skip to content
Snippets Groups Projects
Commit 4ae63c59 authored by catch's avatar catch
Browse files

Issue #2563995 by Temoor, Rakhi Soni, andypost: Remove duplicated check for...

Issue #2563995 by Temoor, Rakhi Soni, andypost: Remove duplicated check for isAdmin() in RoleStorage::isPermissionInRoles()
parent 5d4b6b4a
No related branches found
No related tags found
No related merge requests found
......@@ -13,16 +13,14 @@ class RoleStorage extends ConfigEntityStorage implements RoleStorageInterface {
* {@inheritdoc}
*/
public function isPermissionInRoles($permission, array $rids) {
$has_permission = FALSE;
foreach ($this->loadMultiple($rids) as $role) {
/** @var \Drupal\user\RoleInterface $role */
if ($role->isAdmin() || $role->hasPermission($permission)) {
$has_permission = TRUE;
break;
if ($role->hasPermission($permission)) {
return TRUE;
}
}
return $has_permission;
return FALSE;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment