class RoleStorage
Same name and namespace in other branches
- 11.x core/modules/user/src/RoleStorage.php \Drupal\user\RoleStorage
- 10 core/modules/user/src/RoleStorage.php \Drupal\user\RoleStorage
- 8.9.x core/modules/user/src/RoleStorage.php \Drupal\user\RoleStorage
Controller class for user roles.
Hierarchy
- class \Drupal\Core\Entity\EntityHandlerBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Core\Entity\EntityStorageBase implements \Drupal\Core\Entity\EntityStorageInterface, \Drupal\Core\Entity\EntityHandlerInterface extends \Drupal\Core\Entity\EntityHandlerBase
- class \Drupal\Core\Config\Entity\ConfigEntityStorage implements \Drupal\Core\Config\Entity\ConfigEntityStorageInterface, \Drupal\Core\Config\Entity\ImportableEntityStorageInterface extends \Drupal\Core\Entity\EntityStorageBase
- class \Drupal\user\RoleStorage implements \Drupal\user\RoleStorageInterface extends \Drupal\Core\Config\Entity\ConfigEntityStorage
- class \Drupal\Core\Config\Entity\ConfigEntityStorage implements \Drupal\Core\Config\Entity\ConfigEntityStorageInterface, \Drupal\Core\Config\Entity\ImportableEntityStorageInterface extends \Drupal\Core\Entity\EntityStorageBase
- class \Drupal\Core\Entity\EntityStorageBase implements \Drupal\Core\Entity\EntityStorageInterface, \Drupal\Core\Entity\EntityHandlerInterface extends \Drupal\Core\Entity\EntityHandlerBase
Expanded class hierarchy of RoleStorage
File
-
core/
modules/ user/ src/ RoleStorage.php, line 10
Namespace
Drupal\userView source
class RoleStorage extends ConfigEntityStorage implements RoleStorageInterface {
/**
* {@inheritdoc}
*/
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.