You are here

function _workbench_moderation_access_current_draft in Workbench Moderation 7.3

Same name and namespace in other branches
  1. 7 workbench_moderation.module \_workbench_moderation_access_current_draft()
  2. 7.2 workbench_moderation.module \_workbench_moderation_access_current_draft()

Checks if the user can view the current node revision.

This is the access callback for node/%node/draft as defined in workbench_moderation_menu().

Parameters

$node: The node being acted upon.

Return value

Booelan TRUE or FALSE.

1 call to _workbench_moderation_access_current_draft()
workbench_moderation_node_current_view in ./workbench_moderation.node.inc
Redirects the user to the current revision of the node.
1 string reference to '_workbench_moderation_access_current_draft'
workbench_moderation_menu in ./workbench_moderation.module
Implements hook_menu().

File

./workbench_moderation.module, line 576
Content moderation for Workbench.

Code

function _workbench_moderation_access_current_draft($node) {

  // This tab should only appear for nodes under moderation
  if (!workbench_moderation_node_moderated($node)) {
    return FALSE;
  }
  $state = $node->workbench_moderation;
  return _workbench_moderation_access('view revisions', $node) && !empty($state['published']) && $state['published']->vid != $state['current']->vid;
}