public function __construct(EntityTypeInterface
$entity_type) { $this->entityTypeId =
$entity_type->
id();
$this->entityType =
$entity_type;
} /**
* {@inheritdoc}
*/
public function access(EntityInterface
$entity,
$operation, AccountInterface
$account = NULL,
$return_as_object = FALSE
) { $account =
$this->
prepareUser($account);
$langcode =
$entity->
language()->
getId();
if ($operation === 'view label' &&
$this->viewLabelOperation == FALSE
) { $operation = 'view';
} // If an entity does not have a UUID, either from not being set or from not
// having them, use the 'entity type:ID' pattern as the cache $cid.
$cid =
$entity->
uuid() ?:
$entity->
getEntityTypeId() . ':' .
$entity->
id();
// If the entity is revisionable, then append the revision ID to allow