--- translation.module.orig 2010-05-02 20:12:38.000000000 +0200 +++ translation.module 2010-05-07 10:56:11.000000000 +0200 @@ -76,14 +76,15 @@ function translation_menu() { * all languages). */ function _translation_tab_access($node) { - return !empty($node->language) && translation_supported_type($node->type) && node_access('view', $node) && user_access('translate content'); + global $user; + return !empty($node->language) && translation_supported_type($node->type) && node_access('view', $node) && user_access('translate content') && (($node->uid == $user->uid && user_access('translate own content')) || $user->uid = 1 ); } /** * Implementation of hook_perm(). */ function translation_perm() { - return array('translate content'); + return array('translate content','translate own content'); } /** @@ -94,6 +95,7 @@ function translation_perm() { * is about to be created. */ function translation_form_alter(&$form, $form_state, $form_id) { + global $user; if ($form_id == 'node_type_form') { // Add translation option to content type form. $form['workflow']['language_content_type']['#options'][TRANSLATION_ENABLED] = t('Enabled, with translation'); @@ -122,7 +124,7 @@ function translation_form_alter(&$form, $form['translation'] = array( '#type' => 'fieldset', '#title' => t('Translation settings'), - '#access' => user_access('translate content'), + '#access' => user_access('translate content') || (($node->uid == $user->uid && user_access('translate own content')) || $user->uid = 1), '#collapsible' => TRUE, '#collapsed' => !$node->translate, '#tree' => TRUE, @@ -187,9 +189,11 @@ function translation_nodeapi(&$node, $op return; } + global $user; + switch ($op) { case 'prepare': - if (empty($node->nid) && user_access('translate content') && isset($_GET['translation']) && isset($_GET['language']) && is_numeric($_GET['translation'])) { + if (empty($node->nid) && (user_access('translate content') || (($node->uid == $user->uid && user_access('translate own content')) || $user->uid = 1) ) && isset($_GET['translation']) && isset($_GET['language']) && is_numeric($_GET['translation'])) { $translation_source = node_load($_GET['translation']); if (empty($translation_source) || !node_access('view', $translation_source)) { // Source node not found or no access to view. We should not check