You are here

function taxonomy_permission in Drupal 7

Implements hook_permission().

File

modules/taxonomy/taxonomy.module, line 67
Enables the organization of content into categories.

Code

function taxonomy_permission() {
  $permissions = array(
    'administer taxonomy' => array(
      'title' => t('Administer 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,
        )),
      ),
    );
    $permissions += array(
      'delete terms in ' . $vocabulary->vid => array(
        'title' => t('Delete terms from %vocabulary', array(
          '%vocabulary' => $vocabulary->name,
        )),
      ),
    );
  }
  return $permissions;
}