public function EntityTranslationController::getTranslationAccess

Implements EntityTranslationControllerInterface::getTranslationAccess().

Overrides EntityTranslationControllerInterface::getTranslationAccess

1 call to EntityTranslationController::getTranslationAccess()
EntityTranslationController::entityFormAlter in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php
Implements EntityTranslationControllerInterface::entityFormAlter().

File

drupal/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php, line 102
Definition of Drupal\translation_entity\EntityTranslationController.

Class

EntityTranslationController
Base class for entity translation controllers.

Namespace

Drupal\translation_entity

Code

public function getTranslationAccess(EntityInterface $entity, $langcode) {
  $entity_type = $entity
    ->entityType();
  return (user_access('translate any entity') || user_access("translate {$entity_type} entities")) && ($langcode != $entity
    ->language()->langcode || user_access('edit original values'));
}