You are here

function _publishcontent_publish_access in Publish Content 7

Same name and namespace in other branches
  1. 5.2 publishcontent.module \_publishcontent_publish_access()
  2. 6 publishcontent.module \_publishcontent_publish_access()

Access callback for publish action.

1 string reference to '_publishcontent_publish_access'
publishcontent_menu in ./publishcontent.module
Implements hook_menu().

File

./publishcontent.module, line 87
Add link to publish or unpublish a node, with access control based on the node type

Code

function _publishcontent_publish_access($node, $token = FALSE) {
  if (!is_object($node)) {
    return FALSE;
  }
  if ($token && !drupal_valid_token($token)) {
    return FALSE;
  }
  if (!variable_get('publishcontent_' . $node->type, FALSE)) {
    return FALSE;
  }
  return !$node->status && publishcontent_publish_access($node);
}