public function EntityAccessControllerInterface::viewAccess

Checks 'view' access for a given entity or entity translation.

Parameters

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

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

\Drupal\user\Plugin\Core\Entity\User $account: (optional) The user 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.

2 methods override EntityAccessControllerInterface::viewAccess()
EntityAccessController::viewAccess in drupal/core/lib/Drupal/Core/Entity/EntityAccessController.php
Implements EntityAccessControllerInterface::viewAccess().
EntityTestAccessController::viewAccess in drupal/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestAccessController.php
Implements EntityAccessControllerInterface::view().

File

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

Class

EntityAccessControllerInterface
Defines a common interface for entity access controller classes.

Namespace

Drupal\Core\Entity

Code

public function viewAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, User $account = NULL);