1.20.x taxonomy.module taxonomy_vocabulary_list_permissions($vocabulary)

Helper function to generate standard permission list for a vocabulary.

Parameters

$vocabulary: Fully loaded TaxonomyVocabulary object.

Return value

array: An array of permission names and descriptions.

File

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

Code

function taxonomy_vocabulary_list_permissions($vocabulary) {
  $permissions = array(
    'create terms in ' . $vocabulary->machine_name => array(
      'title' => t('%vocabulary: Create terms', array('%vocabulary' => $vocabulary->name)),
    ),
    'edit terms in ' . $vocabulary->machine_name => array(
      'title' => t('%vocabulary: Edit terms', array('%vocabulary' => $vocabulary->name)),
    ),
    'delete terms in ' . $vocabulary->machine_name => array(
      'title' => t('%vocabulary: Delete terms', array('%vocabulary' => $vocabulary->name)),
    ),
  );

  return $permissions;
}