EntityAccessControlHandlerInterface::access

public EntityAccessControlHandlerInterface::access(EntityInterface $entity, $operation, AccountInterface $account = NULL, $return_as_object = FALSE) Checks access to an operation on a given entity or entity translation. Use \Drupal\Core\Entity\EntityAccessControlHandlerInterface::createAccess() to check access to create an entity. Parameters \Drupal\Core\Entity\EntityInterface $entity: The entity for which to check access. string $operation: The operation access should be checked for. Usually

EntityAccessControlHandlerInterface

Defines an interface for entity access control handlers. Hierarchy interface \Drupal\Core\Entity\EntityAccessControlHandlerInterface File core/lib/Drupal/Core/Entity/EntityAccessControlHandlerInterface.php, line 13 Namespace Drupal\Core\Entity Members Name Modifiers Type Description EntityAccessControlHandlerInterface::access public function Checks access to an operation on a given entity or entity translation. EntityAccessControlHandlerInterface::createAccess public

EntityAccessControlHandler::__construct

public EntityAccessControlHandler::__construct(EntityTypeInterface $entity_type) Constructs an access control handler instance. Parameters \Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition. File core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php, line 53 Class EntityAccessControlHandler Defines a default implementation for entity access control handler. Namespace Drupal\Core\Entity Code public function __construct(EntityTypeInterface $entity_type

EntityAccessControlHandler::setCache

protected EntityAccessControlHandler::setCache($access, $cid, $operation, $langcode, AccountInterface $account) Statically caches whether the given user has access. Parameters \Drupal\Core\Access\AccessResultInterface $access: The access result. string $cid: Unique string identifier for the entity/operation, for example the entity UUID or a custom string. string $operation: The entity operation. Usually one of 'view', 'update', 'create' or 'delete'. string $langcode: The language code for whic

EntityAccessControlHandler::resetCache

public EntityAccessControlHandler::resetCache() Clears all cached access checks. Overrides EntityAccessControlHandlerInterface::resetCache File core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php, line 209 Class EntityAccessControlHandler Defines a default implementation for entity access control handler. Namespace Drupal\Core\Entity Code public function resetCache() { $this->accessCache = array(); }

EntityAccessControlHandler::processAccessHookResults

protected EntityAccessControlHandler::processAccessHookResults(array $access) We grant access to the entity if both of these conditions are met: No modules say to deny access. At least one module says to grant access. Parameters \Drupal\Core\Access\AccessResultInterface[] $access: An array of access results of the fired access hook. Return value \Drupal\Core\Access\AccessResultInterface The combined result of the various access checks' results. All their cacheability metadata is merged as w

EntityAccessControlHandler::prepareUser

protected EntityAccessControlHandler::prepareUser(AccountInterface $account = NULL) Loads the current account object, if it does not exist yet. Parameters \Drupal\Core\Session\AccountInterface $account: The account interface instance. Return value \Drupal\Core\Session\AccountInterface Returns the current account object. File core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php, line 290 Class EntityAccessControlHandler Defines a default implementation for entity access control hand

EntityAccessControlHandler::getCache

protected EntityAccessControlHandler::getCache($cid, $operation, $langcode, AccountInterface $account) Tries to retrieve a previously cached access value from the static cache. Parameters string $cid: Unique string identifier for the entity/operation, for example the entity UUID or a custom string. string $operation: The entity operation. Usually one of 'view', 'update', 'create' or 'delete'. string $langcode: The language code for which to check access. \Drupal\Core\Session\AccountInterface $

EntityAccessControlHandler::fieldAccess

public EntityAccessControlHandler::fieldAccess($operation, FieldDefinitionInterface $field_definition, AccountInterface $account = NULL, FieldItemListInterface $items = NULL, $return_as_object = FALSE) Checks access to an operation on a given entity field. This method does not determine whether access is granted to the entity itself, only the specific field. Callers are responsible for ensuring that entity access is also respected, for example by using \Drupal\Core\Entity\EntityAccessControlHan

EntityAccessControlHandler::createAccess

public EntityAccessControlHandler::createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = array(), $return_as_object = FALSE) Checks access to create an entity. Parameters string $entity_bundle: (optional) The bundle of the entity. Required if the entity supports bundles, defaults to NULL otherwise. \Drupal\Core\Session\AccountInterface $account: (optional) The user session for which to check access, or NULL to check access for the current user. Defaults to NULL