You are here

function publishcontent_publishcontent_unpublish_access in Publish Content 7

Implements hook_publishcontent_unpublish_access().

File

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

Code

function publishcontent_publishcontent_unpublish_access($node, $user) {
  $access = user_access('administer nodes') || user_access('unpublish any content') || user_access('unpublish own content') && $user->uid == $node->uid || user_access('unpublish editable content') && (!isset($node->nid) || node_access('update', $node)) || user_access('unpublish own ' . check_plain($node->type) . ' content', $user) && $user->uid == $node->uid || user_access('unpublish any ' . check_plain($node->type) . ' content') || user_access('unpublish editable ' . check_plain($node->type) . ' content') && (!isset($node->nid) || node_access('update', $node));
  return $access ? PUBLISHCONTENT_ACCESS_ALLOW : PUBLISHCONTENT_ACCESS_IGNORE;
}