function hook_workbench_moderation_access_alter in Workbench Moderation 7.3
Same name and namespace in other branches
- 7 workbench_moderation.api.php \hook_workbench_moderation_access_alter()
Allows modules to alter moderation access.
Parameters
&$access: A boolean access declaration. Passed by reference.
$op: The operation being performed. May be 'view', 'update', 'delete', 'view revisions' or 'moderate'.
$node: The node being acted upon.
2 invocations of hook_workbench_moderation_access_alter()
- _workbench_moderation_access in ./
workbench_moderation.module - Custom access handler for node operations.
- _workbench_moderation_moderate_access in ./
workbench_moderation.module - Checks if a user may make a particular transition on a node.
File
- ./
workbench_moderation.api.php, line 19 - API documentation file for Workbench Moderation.
Code
function hook_workbench_moderation_access_alter(&$access, $op, $node) {
global $user;
// If the node is marked private, only let its owner moderate it.
if (empty($node->private) || $op != 'moderate') {
return;
}
if ($user->uid != $node->uid) {
$access = FALSE;
}
}