interface EntityAccessControllerInterface

Defines a common interface for entity access controller classes.

Hierarchy

Expanded class hierarchy of EntityAccessControllerInterface

All classes that implement EntityAccessControllerInterface

File

drupal/core/lib/Drupal/Core/Entity/EntityAccessControllerInterface.php, line 16
Contains \Drupal\Core\Entity\EntityAccessControllerInterface.

Namespace

Drupal\Core\Entity
View source
interface EntityAccessControllerInterface {

  /**
   * Checks access to an operation on a given entity or entity translation.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity for which to check access.
   * @param string $operation
   *   The operation access should be checked for.
   *   Usually one of "view", "create", "update" or "delete".
   * @param string $langcode
   *   (optional) The language code for which to check access. Defaults to
   *   Language::LANGCODE_DEFAULT.
   * @param \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.
   *
   * @return bool
   *   TRUE if access was granted, FALSE otherwise.
   */
  public function access(EntityInterface $entity, $operation, $langcode = Language::LANGCODE_DEFAULT, AccountInterface $account = NULL);

  /**
   * Clears all cached access checks.
   */
  public function resetCache();

}

Members

Namesort descending Modifiers Type Description Overrides
EntityAccessControllerInterface::access public function Checks access to an operation on a given entity or entity translation. 1
EntityAccessControllerInterface::resetCache public function Clears all cached access checks. 1