diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index a236cfe..14dc381 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -767,7 +767,7 @@ function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary = $form['actions']['delete'] = array( '#type' => 'submit', '#value' => t('Delete'), - '#access' => user_access("delete terms in $vocabulary->vid") || user_access('administer taxonomy'), + '#access' => user_access("delete terms in $vocabulary->machine_name") || user_access('administer taxonomy'), '#weight' => 10, ); } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index dc2847d..007b19c 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -72,12 +72,12 @@ function taxonomy_permission() { ); foreach (taxonomy_get_vocabularies() as $vocabulary) { $permissions += array( - 'edit terms in ' . $vocabulary->vid => array( + 'edit terms in ' . $vocabulary->machine_name => array( 'title' => t('Edit terms in %vocabulary', array('%vocabulary' => $vocabulary->name)), ), ); $permissions += array( - 'delete terms in ' . $vocabulary->vid => array( + 'delete terms in ' . $vocabulary->machine_name => array( 'title' => t('Delete terms from %vocabulary', array('%vocabulary' => $vocabulary->name)), ), ); @@ -369,7 +369,14 @@ function taxonomy_admin_paths() { * Return edit access for a given term. */ function taxonomy_term_edit_access($term) { - return user_access("edit terms in $term->vid") || user_access('administer taxonomy'); + if (user_access('administer taxonomy')) { + return TRUE; + } + if (!isset($term->vocabulary_machine_name)) { + $vocabulary = taxonomy_vocabulary_load($term->vid); + $term->vocabulary_machine_name = $vocabulary->machine_name; + } + return user_access("edit terms in $term->vocabulary_machine_name"); } /**