You are here

function module_grants_invoke_node_access in Module Grants 7

Replicate node.module's $access = module_invoke_all('node_access', $node, $op, $account), using the hook_node_access() saved in module_grants_set_node_access_implementations()

See also

node_access()

module_invoke_all()

1 call to module_grants_invoke_node_access()
_module_grants_node_access in ./module_grants.node.inc
Copied from node_access(), with everything before module_invoke_all('node_access') removed (since our override occurs during module_invoke_all('node_access')). Other changes include: 1. Commented out the $rights caching code, we…

File

./module_grants.module, line 99

Code

function module_grants_invoke_node_access($node, $op, $account) {
  $hook = 'node_access';
  $modules = array_keys(module_grants_set_node_access_implementations());
  $return = array();
  foreach ($modules as $module) {
    $result = module_invoke($module, $hook, $node, $op, $account);
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    }
    elseif (isset($result)) {
      $return[] = $result;
    }
  }
  return $return;
}