function wv_workflow_determine_moderation_permissions in Workbench Email 7
Retrieves only the moderation permission tasks.
Return value
permission Returns the permissions for moderating content
1 call to wv_workflow_determine_moderation_permissions()
- workbench_email_determine_valid_roles in ./
workbench_email.module - Determines the valid roles for a given moderation task and content type(s).
File
- ./
workbench_email.module, line 282 - Code for the Workbench Email Module.
Code
function wv_workflow_determine_moderation_permissions() {
// Per-node-type, per-transition permissions.
// Used by workbench_moderation_state_allowed().
$permissions = array();
$node_types = workbench_moderation_moderate_node_types();
$transitions = workbench_moderation_transitions();
foreach ($transitions as $transition) {
$from_state = $transition->from_name;
$to_state = $transition->to_name;
// Always set a permission to perform all moderation states.
$permissions["moderate content from {$from_state} to {$to_state}"] = TRUE;
// Per-node type permissions are very complex, and should only be used if
// absolutely needed. For right now, this is hardcoded to OFF. To enable it,
// Add this line to settings.php and then reset permissions.
// $conf['workbench_moderation_per_node_type'] = TRUE;
if (variable_get('workbench_moderation_per_node_type', FALSE)) {
foreach ($node_types as $node_type) {
$permissions["moderate {$node_type} state from {$from_state} to {$to_state}"] = TRUE;
}
}
}
return $permissions;
}