You are here

function node_access_grants in Drupal 5

Same name and namespace in other branches
  1. 8 core/modules/node/node.module \node_access_grants()
  2. 4 modules/node.module \node_access_grants()
  3. 6 modules/node/node.module \node_access_grants()
  4. 7 modules/node/node.module \node_access_grants()
  5. 9 core/modules/node/node.module \node_access_grants()
  6. 10 core/modules/node/node.module \node_access_grants()

Fetch an array of permission IDs granted to the given user ID.

The implementation here provides only the universal "all" grant. A node access module should implement hook_node_grants() to provide a grant list for the user.

Parameters

$op: The operation that the user is trying to perform.

$uid: The user ID performing the operation. If omitted, the current user is used.

Return value

An associative array in which the keys are realms, and the values are arrays of grants for those realms.

Related topics

3 calls to node_access_grants()
node_access in modules/node/node.module
Determine whether the current user may perform the given operation on the specified node.
node_access_view_all_nodes in modules/node/node.module
Determine whether the user has a global viewing grant for all nodes.
_node_access_where_sql in modules/node/node.module
Generate an SQL where clause for use in fetching a node listing.

File

modules/node/node.module, line 2883
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_access_grants($op, $uid = NULL) {
  global $user;
  if (isset($uid)) {
    $user_object = user_load(array(
      'uid' => $uid,
    ));
  }
  else {
    $user_object = $user;
  }
  return array_merge(array(
    'all' => array(
      0,
    ),
  ), module_invoke_all('node_grants', $user_object, $op));
}