You are here

function entity_translation_access in Entity Translation 7

Checks whether an entity translation is accessible.

Parameters

$translation: An array representing an entity translation.

Return value

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

3 calls to entity_translation_access()
entity_translation_field_attach_view_alter in ./entity_translation.module
Implements hook_field_attach_view_alter().
entity_translation_field_language_alter in ./entity_translation.module
Implements hook_field_language_alter().
entity_translation_node_view in ./entity_translation.node.inc
Implements hook_node_view().

File

./entity_translation.module, line 1984

Code

function entity_translation_access($entity_type, $translation) {
  return $translation['status'] || user_access('translate any entity') || user_access("translate {$entity_type} entities");
}