function translation_user_can_translate_node

Check if the user has permissions to translate a node.

Parameters

$node: Node being checked.

$account: User object to check translation permissions.

Return value

TRUE if the user can translate a node, FALSE otherwise.

3 calls to translation_user_can_translate_node()

File

drupal/core/modules/translation/translation.module, line 150
Manages content translations.

Code

function translation_user_can_translate_node($node, $account = NULL) {

  // If no user object is supplied, the access check is for the current user.
  if (empty($account)) {
    $account = $GLOBALS['user'];
  }
  return node_access('view', $node, $account) && (user_access('translate all content', $account) || $node->uid == $account->uid && user_access('translate own content', $account));
}