function translation_entity_access

Checks whether an entity translation is accessible.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to be accessed.

string $langcode: The language of the translation to be accessed.

Return value

TRUE if the current user is allowed to view the translation.

1 call to translation_entity_access()
translation_entity_add_access in drupal/core/modules/translation_entity/translation_entity.module
Access callback for the translation addition page.

File

drupal/core/modules/translation_entity/translation_entity.module, line 385
Allows entities to be translated into different languages.

Code

function translation_entity_access(EntityInterface $entity, $langcode) {
  return translation_entity_controller($entity
    ->entityType())
    ->getTranslationAccess($entity, $langcode);
}