You are here

function oa_core_og_perm_ctools_access_settings in Open Atrium Core 7.2

Settings form for the 'by perm' access plugin

1 string reference to 'oa_core_og_perm_ctools_access_settings'
oa_core_og_perm.inc in plugins/access/oa_core_og_perm.inc
Plugin to provide access control based on user permission strings in a group. Taken from Organic Groups but modified to work on nodes that are Group Content

File

plugins/access/oa_core_og_perm.inc, line 30
Plugin to provide access control based on user permission strings in a group. Taken from Organic Groups but modified to work on nodes that are Group Content

Code

function oa_core_og_perm_ctools_access_settings($form, &$form_state, $conf) {
  $perms = array();

  // Get list of permissions
  foreach (og_get_permissions() as $perm => $value) {

    // By keeping them keyed by module we can use optgroups with the
    // 'select' type.
    $perms[$value['module']][$perm] = $value['title'];
  }
  $form['settings']['perm'] = array(
    '#type' => 'select',
    '#options' => $perms,
    '#title' => t('Group permission'),
    '#default_value' => $conf['perm'],
    '#description' => t('Only users with the selected permission flag, in the specified group, will be able to access this.'),
    '#required' => TRUE,
  );
  return $form;
}