You are here

function simple_access_node_grants in Simple Access 5

Same name and namespace in other branches
  1. 8.3 simple_access.module \simple_access_node_grants()
  2. 5.2 simple_access.module \simple_access_node_grants()
  3. 6.2 simple_access.module \simple_access_node_grants()
  4. 7.2 simple_access.module \simple_access_node_grants()

Implementation of hook_node_grants().

@TODO implement to correcly return groups in all cases.

File

./simple_access.module, line 200
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_node_grants($account, $op) {
  $gids = simple_access_groups_from_roles(array_keys($account->roles));
  $grants['simple_access'] = $gids;
  $grants['simple_access_author'] = array(
    $account->uid,
  );
  return $grants;
}