You are here

function workbench_moderation_revision_access in Workbench Moderation 7.2

Access callback used to check if a revision is accessible.

This re-uses the node_access() as well as state_flow_menu_node_access(). Our implementation of hook_node_access() allows fine grained access control based on the workflow state of a node.

1 string reference to 'workbench_moderation_revision_access'
workbench_moderation_menu_alter in ./workbench_moderation.module
Implements hook_menu_alter().

File

./workbench_moderation.module, line 216
workbench_moderation.module

Code

function workbench_moderation_revision_access($node, $op = 'view', $account = NULL) {

  // Normal behavior for unmoderated nodes.
  if (state_flow_entity_load_state_machine($node, 'node')
    ->ignore()) {
    return _node_revision_access($node, $op);
  }

  // View access is controlled in detail by our hook_node_access implementation.
  if ($op == 'view') {
    return node_access('view', $node, $account);
  }

  // Run access check by state_flow.
  return state_flow_menu_node_access($node, $account);
}