function views_plugin_access_perm::options_form

3.x views_plugin_access_perm.inc views_plugin_access_perm::options_form(&$form, &$form_state)
2.x views_plugin_access_perm.inc views_plugin_access_perm::options_form(&$form, &$form_state)

Provide the default form for setting options.

Overrides views_plugin_access::options_form

File

plugins/views_plugin_access_perm.inc, line 23

Class

views_plugin_access_perm
Access plugin that provides permission-based access control.

Code

function options_form(&$form, &$form_state) {
  $perms = array();
  // Get list of permissions
  foreach (module_list(FALSE, FALSE, TRUE) as $module) {
    if ($permissions = module_invoke($module, 'perm')) {
      $perms[$module] = drupal_map_assoc($permissions);
    }
  }
  $form['perm'] = array(
    '#type' => 'select',
    '#options' => $perms,
    '#title' => t('Permission'),
    '#default_value' => $this->options['perm'],
    '#description' => t('Only users with the selected permission flag will be able to access this display. Note that users with "access all views" can see any view, regardless of other permissions.'),
  );
}