menu_node_edit_check

Versions
menu_node_edit
menu_node_edit_check($node, $account = NULL)

Check node editing access based on menu relationships.

This function checks for editing access to a specific node. Note that we check node_access() in cases where the node is not within a menu section. We also allow the special permission 'edit all TYPE content in assigned sections' to overrule other node_access rules.

Parameters

$node The node object being requested.

$account The user account being checked.

Return value

Boolean TRUE or FALSE.

Code

./menu_node_edit.module, line 131

<?php
function menu_node_edit_check($node, $account = NULL) {
  $items = menu_node_edit_check_rules($node, $account);
  // If an array is not returned, we have no stake here, so return normal access control.
  if (!is_array($items)) {
    return $items;
  }
  // If node_access() returned true, we will not get this far.
  // The 'edit all X content in assigned sections' is an extension of normal
  // node editing privileges. Without it, no need to run more checks.
  if (!user_access('edit all '. $node->type .' content in assigned sections', $account)) {
    return FALSE;
  }
  // Otherwise, check the user's privileges from this module.
  return menu_node_edit_check_user($items, $account);
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List