public function EntityAccessControllerInterface::access

Checks access to an operation on a given entity or entity translation.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for which to check access.

string $operation: The operation access should be checked for. Usually one of "view", "create", "update" or "delete".

string $langcode: (optional) The language code for which to check access. Defaults to Language::LANGCODE_DEFAULT.

\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 value

bool TRUE if access was granted, FALSE otherwise.

1 method overrides EntityAccessControllerInterface::access()
EntityAccessController::access in drupal/core/lib/Drupal/Core/Entity/EntityAccessController.php
Checks access to an operation on a given entity or entity translation.

File

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

Class

EntityAccessControllerInterface
Defines a common interface for entity access controller classes.

Namespace

Drupal\Core\Entity

Code

public function access(EntityInterface $entity, $operation, $langcode = Language::LANGCODE_DEFAULT, AccountInterface $account = NULL);