You are here

function redhen_org_permission in RedHen CRM 7

Implements hook_permission().

File

modules/redhen_org/redhen_org.module, line 568

Code

function redhen_org_permission() {
  $permissions = array(
    'administer redhen_org types' => array(
      'title' => t('Administer RedHen Organization Types'),
      'description' => t('Manage RedHen organization types and their structure.'),
    ),
    'administer redhen orgs' => array(
      'title' => t('Administer RedHen Organizations'),
      'description' => t('Perform administration tasks for RedHen Organizations.'),
    ),
    'manage redhen orgs' => array(
      'title' => t('Manage RedHen Organizations'),
      'description' => t('Create, update or delete RedHen Organizations.'),
    ),
    'manage redhen org revisions' => array(
      'title' => t('Manage RedHen Organization Revisions'),
      'description' => t('Update or delete RedHen Organization revisions.'),
    ),
    'access redhen orgs' => array(
      'title' => t('Access Redhen Organizations'),
      'description' => t('View for Redhen Organizations.'),
    ),
    'access redhen org revisions' => array(
      'title' => t('Access Redhen Organization Revisions'),
      'description' => t('View for Redhen Organizations revisions'),
    ),
  );
  foreach (redhen_org_get_types() as $type => $info) {
    $create_org_of_type_permission = 'create ' . $type . ' orgs';
    $permissions[$create_org_of_type_permission] = array(
      'title' => t('Create @organization_type Organizations', array(
        '@organization_type' => $info->label,
      )),
      'description' => t('Create an organization of the type @organization_type.', array(
        '@organization_type' => $info->label,
      )),
    );
  }
  return $permissions;
}