function translation_entity_access

Checks whether an entity translation is accessible.

Parameters

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

$op: The operation to be performed on the translation. Possible values are:

  • "view"
  • "update"
  • "delete"
  • "create"

Return value

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

3 calls to translation_entity_access()
translation_entity_add_access in drupal/core/modules/translation_entity/translation_entity.module
Access callback for the translation addition page.
translation_entity_delete_access in drupal/core/modules/translation_entity/translation_entity.module
Access callback for the translation delete page.
translation_entity_edit_access in drupal/core/modules/translation_entity/translation_entity.module
Access callback for the translation edit page.

File

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

Code

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