You are here

function term_merge_permission in Term Merge 7

Implements hook_permission().

File

./term_merge.module, line 109
Provide functionality for merging taxonomy terms one into another.

Code

function term_merge_permission() {
  $permissions = array();
  $permissions['administer term merge'] = array(
    'title' => t('Administer Term merge'),
    'description' => t('Administer settings of the Term merge module.'),
  );
  $permissions['merge terms'] = array(
    'title' => t('Merge any terms'),
    'description' => t('Gives the ability to merge any taxonomy terms.'),
  );
  $vocabularies = taxonomy_get_vocabularies();
  foreach ($vocabularies as $vocabulary) {
    $permissions['merge ' . $vocabulary->machine_name . ' terms'] = array(
      'title' => t('Merge %name vocabulary terms', array(
        '%name' => $vocabulary->name,
      )),
      'description' => t('Gives the ability to merge taxonomy terms that belong to vocabulary %name.', array(
        '%name' => $vocabulary->name,
      )),
    );
  }
  return $permissions;
}