Skip navigation


6 node.module node_access_grants($op, $account = NULL)
7 node.module node_access_grants($op, $account = NULL)

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.


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

$account: The user object for the user 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()


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


function node_access_grants($op, $account = NULL) {

  if (!isset($account)) {
    $account = $GLOBALS['user'];

  return array_merge(array('all' => array(0)), module_invoke_all('node_grants', $account, $op));