You are here

function access_unpublished_workbench_moderation_access_alter in Access unpublished 7

Implements hook_workbench_moderation_access_alter().

Return $access = TRUE if a node has an active revision and url hash matches reference hash.

File

./access_unpublished.module, line 126
Drupal module: Access unpublished.

Code

function access_unpublished_workbench_moderation_access_alter(&$access, $op, $node) {

  // Check user permission
  if (user_access('access unpublished view workbench moderation drafts')) {

    // Check that we are viewing a draft
    if ($node->workbench_moderation['current']->is_current == 1 && $node->workbench_moderation['current']->published == '0') {
      if (_access_unpublished_check_hash($node->nid)) {
        $access = TRUE;
      }
    }
  }
}