function publishcontent_publishcontent_publish_access in Publish Content 7
Implements hook_publishcontent_publish_access().
File
- ./
publishcontent.module, line 161 - Add link to publish or unpublish a node, with access control based on the node type
Code
function publishcontent_publishcontent_publish_access($node, $user) {
$access = user_access('administer nodes') || user_access('publish any content') || user_access('publish own content') && $user->uid == $node->uid || user_access('publish editable content') && (!isset($node->nid) || node_access('update', $node)) || user_access('publish own ' . check_plain($node->type) . ' content', $user) && $user->uid == $node->uid || user_access('publish any ' . check_plain($node->type) . ' content') || user_access('publish editable ' . check_plain($node->type) . ' content') && (!isset($node->nid) || node_access('update', $node));
return $access ? PUBLISHCONTENT_ACCESS_ALLOW : PUBLISHCONTENT_ACCESS_IGNORE;
}