function RoleStorage::isPermissionInRoles
Same name in other branches
- 9 core/modules/user/src/RoleStorage.php \Drupal\user\RoleStorage::isPermissionInRoles()
- 8.9.x core/modules/user/src/RoleStorage.php \Drupal\user\RoleStorage::isPermissionInRoles()
- 10 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) {
foreach ($this->loadMultiple($rids) as $role) {
/** @var \Drupal\user\RoleInterface $role */
if ($role->hasPermission($permission)) {
return TRUE;
}
}
return FALSE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.