You are here

function simple_access_group_revoke_form in Simple Access 6.2

Same name and namespace in other branches
  1. 8.3 simple_access.module \simple_access_group_revoke_form()
  2. 7.2 simple_access.module \simple_access_group_revoke_form()

Configure revoke group permissions

File

./simple_access.module, line 836
This module allows administrators to make nodes viewable by specific 'access groups'. Each access group can contain any number of roles. If a node is not assigned to any access groups, it will remain viewable by all users.

Code

function simple_access_group_revoke_form($settings = array()) {
  $form = array();
  $form['sa_group_permissions'] = array(
    '#tree' => TRUE,
    '#theme' => 'simple_access_form',
    '#admin' => TRUE,
  );
  $groups = simple_access_get_groups();
  foreach ($groups as $gid => $group) {
    $form['sa_group_permissions'][$gid]['name'] = array(
      '#value' => $group['name'],
    );
    $form['sa_group_permissions'][$gid]['sa_view'] = array(
      '#type' => 'checkbox',
      '#default_value' => $settings['sa_group_permissions'][$gid]['sa_view'],
    );
    $form['sa_group_permissions'][$gid]['sa_update'] = array(
      '#type' => 'checkbox',
      '#default_value' => $settings['sa_group_permissions'][$gid]['sa_update'],
    );
    $form['sa_group_permissions'][$gid]['sa_delete'] = array(
      '#type' => 'checkbox',
      '#default_value' => $settings['sa_group_permissions'][$gid]['sa_delete'],
    );
  }
  return $form;
}