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
- 9 core/modules/user/src/RoleStorage.php \Drupal\user\RoleStorage
- 8.9.x core/modules/user/src/RoleStorage.php \Drupal\user\RoleStorage
Defines the storage handler 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;
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
|---|---|---|---|---|
| ConfigEntityStorage::$configFactory | protected | property | The config factory service. | |
| ConfigEntityStorage::$configStorage | protected | property | The config storage service. | |
| ConfigEntityStorage::$languageManager | protected | property | The language manager. | |
| ConfigEntityStorage::$overrideFree | protected | property | Determines if the underlying configuration is retrieved override free. | |
| ConfigEntityStorage::$uuidKey | protected | property | ||
| ConfigEntityStorage::buildCacheId | protected | function | ||
| ConfigEntityStorage::createFromStorageRecord | public | function | ||
| ConfigEntityStorage::createInstance | public static | function | ||
| ConfigEntityStorage::doCreate | protected | function | ||
| ConfigEntityStorage::doDelete | protected | function | ||
| ConfigEntityStorage::doLoadMultiple | protected | function | ||
| ConfigEntityStorage::doSave | protected | function | ||
| ConfigEntityStorage::getIDFromConfigName | public static | function | ||
| ConfigEntityStorage::getPrefix | protected | function | Returns the prefix used to create the configuration name. | |
| ConfigEntityStorage::getQueryServiceName | protected | function | ||
| ConfigEntityStorage::has | protected | function | ||
| ConfigEntityStorage::hasData | public | function | ||
| ConfigEntityStorage::importCreate | public | function | ||
| ConfigEntityStorage::importDelete | public | function | ||
| ConfigEntityStorage::importRename | public | function | ||
| ConfigEntityStorage::importUpdate | public | function | ||
| ConfigEntityStorage::invokeHook | protected | function | Invokes a hook on behalf of the entity. | |
| ConfigEntityStorage::loadMultipleOverrideFree | public | function | ||
| ConfigEntityStorage::loadOverrideFree | public | function | ||
| ConfigEntityStorage::mapToStorageRecord | protected | function | Maps from an entity object to the storage record. | |
| ConfigEntityStorage::MAX_ID_LENGTH | constant | Length limit of the configuration entity ID. | ||
| ConfigEntityStorage::resetCache | public | function | ||
| ConfigEntityStorage::save | public | function | Implements Drupal\Core\Entity\EntityStorageInterface::save(). | |
| ConfigEntityStorage::updateFromStorageRecord | public | function | ||
| ConfigEntityStorage::_doCreateFromStorageRecord | protected | function | Helps create a configuration entity from storage values. | |
| ConfigEntityStorage::__construct | public | function | Constructs a ConfigEntityStorage object. | |
| DependencySerializationTrait::$_entityStorages | protected | property | An array of entity type IDs keyed by the property name of their storages. | |
| DependencySerializationTrait::$_serviceIds | protected | property | An array of service IDs keyed by property name used for serialization. | |
| DependencySerializationTrait::__sleep | public | function | ||
| DependencySerializationTrait::__wakeup | public | function | ||
| EntityHandlerBase::$moduleHandler | protected | property | The module handler to invoke hooks on. | |
| EntityHandlerBase::moduleHandler | protected | function | Gets the module handler. | |
| EntityHandlerBase::setModuleHandler | public | function | Sets the module handler for this handler. | |
| EntityStorageBase::$baseEntityClass | private | property | Name of the base entity class. | |
| EntityStorageBase::$entityIdsToLoad | protected | property | Entity IDs awaiting loading. | |
| EntityStorageBase::$entityType | protected | property | Information about the entity type. | |
| EntityStorageBase::$entityTypeId | protected | property | Entity type ID for this storage. | |
| EntityStorageBase::$idKey | protected | property | Name of the entity's ID field in the entity database table. | |
| EntityStorageBase::$langcodeKey | protected | property | The name of the entity langcode property. | |
| EntityStorageBase::$memoryCache | protected | property | The memory cache. | |
| EntityStorageBase::$memoryCacheTag | protected | property | The memory cache tag. | |
| EntityStorageBase::$uuidService | protected | property | The UUID service. | |
| EntityStorageBase::buildPropertyQuery | protected | function | Builds an entity query. | |
| EntityStorageBase::create | public | function | ||
| EntityStorageBase::delete | public | function | ||
| EntityStorageBase::doPostSave | protected | function | Performs post save entity processing. | |
| EntityStorageBase::doPreSave | protected | function | Performs presave entity processing. | |
| EntityStorageBase::getAggregateQuery | public | function | ||
| EntityStorageBase::getEntitiesByClass | protected | function | Indexes the given array of entities by their class name and ID. | |
| EntityStorageBase::getEntityClass | public | function | ||
| EntityStorageBase::getEntityType | public | function | ||
| EntityStorageBase::getEntityTypeId | public | function | ||
| EntityStorageBase::getFromStaticCache | protected | function | Gets entities from the static cache. | |
| EntityStorageBase::getQuery | public | function | ||
| EntityStorageBase::load | public | function | ||
| EntityStorageBase::loadByProperties | public | function | ||
| EntityStorageBase::loadMultiple | public | function | ||
| EntityStorageBase::loadUnchanged | public | function | ||
| EntityStorageBase::mapFromStorageRecords | protected | function | Maps from storage records to entity objects. | |
| EntityStorageBase::postLoad | protected | function | Attaches data to entities upon loading. | |
| EntityStorageBase::preLoad | protected | function | Gathers entities from a 'preload' step. | |
| EntityStorageBase::restore | public | function | ||
| EntityStorageBase::setStaticCache | protected | function | Stores entities in the static entity cache. | |
| EntityStorageInterface::FIELD_LOAD_CURRENT | constant | Load the most recent version of an entity's field data. | ||
| EntityStorageInterface::FIELD_LOAD_REVISION | constant | Load the version of an entity's field data specified in the entity. | ||
| RoleStorage::isPermissionInRoles | public | function | Returns whether a permission is in one of the passed in roles. | Overrides RoleStorageInterface::isPermissionInRoles |
| StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | |
| StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | |
| StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | |
| StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | |
| StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | |
| StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.