Commit c01358cb authored by fmitchell's avatar fmitchell

Check access by perm, then check if ignored, then alter

parent 36cd164a
......@@ -247,15 +247,20 @@ function state_flow_menu_node_access($node, $account = NULL) {
// If the user has the "manage content workflow" permission, then allow access
// to workflow pages.
$access = user_access('manage content workflow', $account);
$has_access = user_access('manage content workflow', $account);
// Allow other modules to alter this decision
drupal_alter('state_flow_menu_node_access', $access, $node, $account);
//check to see if node type is ignored
$is_ignored = state_flow_load_state_machine($node)->ignore();
//check to see if node type is ignored, but only for those already given access
if ($access) {
$access = (!state_flow_load_state_machine($node)->ignore()) ? FALSE : TRUE;
if ($has_access && !$is_ignored) {
$access = TRUE;
}
else {
$access = FALSE;
}
// Allow other modules to alter this decision
drupal_alter('state_flow_menu_node_access', $access, $node, $account);
return $access;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment