Implements EntityTranslationControllerInterface::getTranslationAccess().
Overrides EntityTranslationControllerInterface::getTranslationAccess
public function getTranslationAccess(EntityInterface $entity, $op) {
// @todo Move this logic into a translation access controller checking also
// the translation language and the given account.
$info = $entity
->entityInfo();
$translate_permission = TRUE;
// If no permission granularity is defined this entity type does not need an
// explicit translate permission.
if (!user_access('translate any entity') && !empty($info['permission_granularity'])) {
$translate_permission = user_access($info['permission_granularity'] == 'bundle' ? "translate {$entity->bundle()} {$entity->entityType()}" : "translate {$entity->entityType()}");
}
return $translate_permission && user_access("{$op} entity translations");
}