You are here

function nodeaccess_node_grants in Nodeaccess 5

Same name and namespace in other branches
  1. 8.2 nodeaccess.module \nodeaccess_node_grants()
  2. 8 nodeaccess.module \nodeaccess_node_grants()
  3. 6.2 nodeaccess.module \nodeaccess_node_grants()
  4. 6 nodeaccess.module \nodeaccess_node_grants()
  5. 7 nodeaccess.module \nodeaccess_node_grants()

Implementation of hook_node_grants().

File

./nodeaccess.module, line 560

Code

function nodeaccess_node_grants($account, $op) {
  global $user;
  $roles = is_array($user->roles) ? array_keys($user->roles) : array(
    -1,
  );
  return array(
    'nodeaccess_rid' => $roles,
    'nodeaccess_uid' => array(
      $user->uid,
    ),
    'nodeaccess_author' => array(
      $user->uid,
    ),
  );
}