function simple_access_get_roles in Simple Access 7.2
Same name and namespace in other branches
- 5.2 simple_access.module \simple_access_get_roles()
- 5 simple_access.module \simple_access_get_roles()
- 6.2 simple_access.module \simple_access_get_roles()
Get all simple access roles.
1 call to simple_access_get_roles()
- simple_access_get_groups in ./
simple_access.module - Return list of groups.
File
- ./
simple_access.module, line 590 - 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_roles($gid) {
$result = db_select('simple_access_roles', 'r')
->fields('r', array(
'rid',
))
->condition('gid', $gid)
->execute();
return array_keys($result
->fetchAllAssoc('rid', PDO::FETCH_ASSOC));
}