public function EntityTestAccessController::viewAccess

Implements EntityAccessControllerInterface::view().

Overrides EntityAccessControllerInterface::viewAccess

File

drupal/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestAccessController.php, line 22
Contains Drupal\entity_test\EntityTestAccessController.

Class

EntityTestAccessController
Defines the access controller for the test entity type.

Namespace

Drupal\entity_test

Code

public function viewAccess(EntityInterface $entity, $langcode = LANGUAGE_DEFAULT, User $account = NULL) {
  if ($langcode != LANGUAGE_DEFAULT) {
    return user_access('view test entity translations', $account);
  }
  return user_access('view test entity', $account);
}