You are here

function oa_buttons_og_permission in Open Atrium Core 7.2

Implements hook_og_permission().

File

modules/oa_buttons/oa_buttons.module, line 223

Code

function oa_buttons_og_permission() {
  $perms = array();
  if (module_exists('oa_subspaces') && ($vocabulary = oa_core_taxonomy_vocabulary('space_type')) && ($terms = taxonomy_get_tree($vocabulary->vid, 0))) {
    $perms['use any oa button space_type'] = array(
      'title' => t('Use any space type'),
      'description' => t('Users may use any of the available space types..'),
      'restrict access' => TRUE,
      'default role' => array(
        OG_ADMINISTRATOR_ROLE,
      ),
    );
    foreach ($terms as $term) {
      $perms[_oa_buttons_perm_name('space_type', $term->tid)] = array(
        'title' => t('Use @name space type', array(
          '@name' => $term->name,
        )),
        'description' => t('Users may select @name space type on create space form. This permission will be ignored if user can create space globally or if they can administer current group.', array(
          '@name' => $term->name,
        )),
        'restrict access' => TRUE,
        'default role' => array(
          OG_ADMINISTRATOR_ROLE,
        ),
      );
    }
  }
  return $perms;
}