function RoleStorage::isPermissionInRoles
Same name in other branches
- 9 core/modules/user/src/RoleStorage.php \Drupal\user\RoleStorage::isPermissionInRoles()
- 10 core/modules/user/src/RoleStorage.php \Drupal\user\RoleStorage::isPermissionInRoles()
- 11.x core/modules/user/src/RoleStorage.php \Drupal\user\RoleStorage::isPermissionInRoles()
Overrides RoleStorageInterface::isPermissionInRoles
File
-
core/
modules/ user/ src/ RoleStorage.php, line 15
Class
- RoleStorage
- Controller class for user roles.
Namespace
Drupal\userCode
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;
}
}
return $has_permission;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.