function translation_entity_translate_access

Access callback for the translation overview page.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity whose translation overview should be displayed.

1 call to translation_entity_translate_access()
comment_links in drupal/core/modules/comment/comment.module
Adds reply, edit, delete, etc. links, depending on user permissions.
1 string reference to 'translation_entity_translate_access'
translation_entity_entity_info_alter in drupal/core/modules/translation_entity/translation_entity.module
Implements hook_entity_info_alter().

File

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

Code

function translation_entity_translate_access(EntityInterface $entity) {
  $entity_type = $entity
    ->entityType();
  return empty($entity
    ->language()->locked) && language_multilingual() && translation_entity_enabled($entity_type, $entity
    ->bundle()) && (user_access('translate any entity') || user_access("translate {$entity_type} entities"));
}