Index: modules/taxonomy/taxonomy.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v retrieving revision 1.72 diff -u -p -r1.72 taxonomy.admin.inc --- modules/taxonomy/taxonomy.admin.inc 9 Oct 2009 01:00:05 -0000 1.72 +++ modules/taxonomy/taxonomy.admin.inc 13 Oct 2009 15:49:14 -0000 @@ -694,7 +694,9 @@ function taxonomy_form_term($form, &$for if ($edit['tid']) { $form['delete'] = array( '#type' => 'submit', - '#value' => t('Delete')); + '#value' => t('Delete'), + '#access' => user_access("delete terms in $vocabulary->$vid") || user_access('administer taxonomy'), + ); $form['tid'] = array( '#type' => 'value', '#value' => $edit['tid']); Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.516 diff -u -p -r1.516 taxonomy.module --- modules/taxonomy/taxonomy.module 10 Oct 2009 18:42:52 -0000 1.516 +++ modules/taxonomy/taxonomy.module 13 Oct 2009 15:49:14 -0000 @@ -10,12 +10,28 @@ * Implement hook_permission(). */ function taxonomy_permission() { - return array( + + $permissions = array( 'administer taxonomy' => array( 'title' => t('Administer taxonomy'), 'description' => t('Manage taxonomy vocabularies and terms.'), ), ); + foreach (taxonomy_get_vocabularies() as $vocabulary) { + $permissions += array( + 'edit terms in ' . $vocabulary->vid => array( + 'title' => t('Edit terms in %vocabulary', array('%vocabulary' => $vocabulary->name)), + 'description' => t('Edit terms in the %vocabulary vocabulary.', array('%vocabulary' => $vocabulary->name)), + ), + ); + $permissions += array( + 'delete terms in ' . $vocabulary->vid => array( + 'title' => t('Delete terms in %vocabulary', array('%vocabulary' => $vocabulary->name)), + 'description' => t('Delete terms in the %vocabulary vocabulary.', array('%vocabulary' => $vocabulary->name)), + ), + ); + } + return $permissions; } /** @@ -210,7 +226,8 @@ function taxonomy_menu() { 'title' => 'Edit term', 'page callback' => 'taxonomy_term_edit', 'page arguments' => array(2), - 'access arguments' => array('administer taxonomy'), + 'access callback' => 'taxonomy_term_edit_access', + 'access arguments' => array(2), 'type' => MENU_LOCAL_TASK, 'weight' => 10, 'file' => 'taxonomy.pages.inc', @@ -273,6 +290,13 @@ function taxonomy_menu() { } /** + * 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'); +} + +/** * Return the vocabulary name given the vocabulary object. */ function taxonomy_admin_vocabulary_title_callback($vocabulary) {