You are here

function hook_nodeaccess_grants_alter in Nodeaccess 7

Allow for changes to be made on the entire grants array for a node before saving.

Parameters

array &$grants: array( array( 'gid' => (int) gid for realm, 'realm' => (string) what realm the access grant belongs to (ex: nodeaccess_rid). 'grant_view' => (int) view access being granted, 'grant_update' => (int) update access being granted, 'grant_delete' => (int) delete access being granted, ), ... )

$node: Node object the grant is being applied to.

1 invocation of hook_nodeaccess_grants_alter()
nodeaccess_set_grants in ./nodeaccess.module
Set all grants for a node to nodeaccess table and acquire them.

File

./nodeaccess.api.php, line 27
API documentation for Nodeaccess module.

Code

function hook_nodeaccess_grants_alter(&$grants, $node) {
  foreach ($grants as $gid => $grant) {

    // Make some changes to the grants.
  }
}