You are here

function _publishcontent_unpublish_access in Publish Content 5.2

Same name and namespace in other branches
  1. 6 publishcontent.module \_publishcontent_unpublish_access()
  2. 7 publishcontent.module \_publishcontent_unpublish_access()
3 calls to _publishcontent_unpublish_access()
publishcontent_form_alter in ./publishcontent.module
Implementation of hook_form_alter()
publishcontent_menu in ./publishcontent.module
Implementation of hook_menu().
publishcontent_views_handler_node_publish in ./publishcontent.module
display a link to publish a node

File

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

Code

function _publishcontent_unpublish_access($node) {
  global $user;
  return $node->status && (user_access('unpublish *all* content') || user_access('unpublish own ' . check_plain($node->type) . ' content', $user) && $user->uid == $node->uid || user_access('unpublish ' . check_plain($node->type) . ' content'));
}