You are here

function workbench_access_check in Workbench Access 7

Check to see if a user can access the node for this operation.

Parameters

$op: The operation being performed.

$type: The node type being requested.

$access_ids: The access_id array for this node.

$account_access: The access rules for the user performing the action.

Return value

The id of the rule that grants access, or FALSE if none do.

1 call to workbench_access_check()
workbench_access_node_access in ./workbench_access.module
Implements hook_node_access().

File

./workbench_access.module, line 451
Workbench Access module file.

Code

function workbench_access_check($op, $type, $access_ids, $account_access) {
  foreach ($access_ids as $access_id) {
    if ($id = workbench_access_in_tree($access_id, $account_access)) {
      if (in_array('all', $account_access[$id][$op]) || in_array($type, $account_access[$id][$op])) {
        return $id;
      }
    }
  }
  return FALSE;
}