? 534330-token.patch
? 552418-edit-own-nodes.patch
? 552418-node-access.patch
? 5x-hook.patch
? 5x-menu.patch
? 605916-link.patch
? test.patch
Index: menu_node_edit.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/menu_node_edit/menu_node_edit.module,v
retrieving revision 1.9
diff -u -p -r1.9 menu_node_edit.module
--- menu_node_edit.module	15 Jul 2009 14:06:59 -0000	1.9
+++ menu_node_edit.module	22 Oct 2009 21:05:19 -0000
@@ -130,17 +130,18 @@ function menu_node_edit_user_page_access
  *   Boolean TRUE or FALSE.
  */
 function menu_node_edit_check($node, $account = NULL) {
-  $items = menu_node_edit_check_rules($node->nid, $account);
+  $items = menu_node_edit_check_rules($node, $account);
   // If nothing returned, we have no stake here, so return normal access control.
-  if (empty($items)) {
-    return node_access('update', $node, $account);
+  if (!is_array($items) || empty($items)) {
+    return (bool) $items;
   }
   // Otherwise, check the user's privileges.
   $access = menu_node_edit_check_user($items, $account);
   // This only matters if $access returns TRUE and the user
   // does not have access to all node types in this section.
-  if ($access && !user_access('edit all '. $node->type .' content in assigned sections', $account)) {
-    return node_access('update', $node, $account);
+  // If node_access() returned true, we will not get this far.
+  if (!user_access('edit all '. $node->type .' content in assigned sections', $account)) {
+    return FALSE;
   }
   return $access;
 }
@@ -155,13 +156,16 @@ function menu_node_edit_check($node, $ac
  * @return
  *   The necessary menu item information, or FALSE.
  */
-function menu_node_edit_check_rules($nid, $account = NULL) {
+function menu_node_edit_check_rules($node, $account = NULL) {
   $items = menu_node_get_links($nid);
   $sections = menu_node_edit_get_sections();
   // In the following cases, this module makes no assertions.
-  if (empty($items) || empty($sections) || user_access('administer nodes', $account)) {
+  if (empty($items) || empty($sections)) {
     return FALSE;
   }
+  if (node_access('update', $node, $account)) {
+    return TRUE;
+  }
   return $items;
 }
 
