You are here

function simple_access_get_groups in Simple Access 5

Same name and namespace in other branches
  1. 8.3 simple_access.module \simple_access_get_groups()
  2. 5.2 simple_access.module \simple_access_get_groups()
  3. 6.2 simple_access.module \simple_access_get_groups()
  4. 7.2 simple_access.module \simple_access_get_groups()
2 calls to simple_access_get_groups()
simple_access_nodes in ./simple_access.module
List hidden, editable, and deletable nodes
simple_access_page_overview in ./simple_access.module

File

./simple_access.module, line 438
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_get_groups() {
  $groups = array();
  $sql = db_query('SELECT gid, name FROM {simple_access_groups} ORDER BY weight, name');
  while ($g = db_fetch_object($sql)) {
    $groups[$g->gid]['name'] = $g->name;
    $groups[$g->gid]['gid'] = $g->gid;
    $groups[$g->gid]['roles'] = simple_access_get_roles($g->gid);
  }
  return $groups;
}