Index: modules/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node.module,v
retrieving revision 1.651
diff -u -r1.651 node.module
--- modules/node.module	16 Jun 2006 20:16:27 -0000	1.651
+++ modules/node.module	29 Jun 2006 15:39:42 -0000
@@ -587,7 +587,7 @@
  * Implementation of hook_perm().
  */
 function node_perm() {
-  return array('administer nodes', 'access content', 'view revisions', 'revert revisions');
+  return array('administer nodes', 'access content', 'view revisions', 'revert revisions', 'moderate nodes');
 }

 /**
@@ -835,7 +835,7 @@
   if ($may_cache) {
     $items[] = array('path' => 'admin/node', 'title' => t('content'),
       'callback' => 'node_admin_nodes',
-      'access' => user_access('administer nodes'));
+      'access' => (user_access('administer nodes') || user_access('moderate nodes')));
     $items[] = array('path' => 'admin/node/overview', 'title' => t('list'),
       'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);

@@ -914,14 +914,21 @@
  * List node administration operations that can be performed.
  */
 function node_operations() {
-  $operations = array(
-    'approve' =>   array(t('Approve the selected posts'), 'UPDATE {node} SET status = 1, moderate = 0 WHERE nid = %d'),
-    'promote' =>   array(t('Promote the selected posts'), 'UPDATE {node} SET status = 1, promote = 1 WHERE nid = %d'),
-    'sticky' =>    array(t('Make the selected posts sticky'), 'UPDATE {node} SET status = 1, sticky = 1 WHERE nid = %d'),
-    'demote' =>    array(t('Demote the selected posts'), 'UPDATE {node} SET promote = 0 WHERE nid = %d'),
-    'unpublish' => array(t('Unpublish the selected posts'), 'UPDATE {node} SET status = 0 WHERE nid = %d'),
-    'delete' =>    array(t('Delete the selected posts'), '')
-  );
+  if (user_access('administer nodes')){
+    $operations = array(    'approve' =>   array(t('Approve the selected posts'), 'UPDATE {node} SET status = 1, moderate = 0 WHERE nid = %d'),
+      'promote' =>   array(t('Promote the selected posts'), 'UPDATE {node} SET status = 1, promote = 1 WHERE nid = %d'),
+      'sticky' =>    array(t('Make the selected posts sticky'), 'UPDATE {node} SET status = 1, sticky = 1 WHERE nid = %d'),
+      'demote' =>    array(t('Demote the selected posts'), 'UPDATE {node} SET promote = 0 WHERE nid = %d'),
+      'unpublish' => array(t('Unpublish the selected posts'), 'UPDATE {node} SET status = 0 WHERE nid = %d'),
+      'delete' =>    array(t('Delete the selected posts'), '')
+    );
+  }
+  elseif (user_access('moderate nodes')) {
+    $operations = array(
+      'approve' =>   array(t('Approve the selected posts'), 'UPDATE {node} SET status = 1, moderate = 0 WHERE nid = %d'),
+      'unpublish' => array(t('Unpublish the selected posts'), 'UPDATE {node} SET status = 0 WHERE nid = %d'),
+    );
+  }
   return $operations;
 }

@@ -1132,7 +1139,12 @@

   $filter = node_build_filter_query();

-  $result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] .' ORDER BY n.changed DESC', 50, 0, NULL, $filter['args']);
+  if (user_access('administer nodes')){
+    $result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] .' ORDER BY n.changed DESC', 50, 0, NULL, $filter['args']);
+  }
+  elseif (user_access('moderate nodes')) {
+    $result = pager_query(db_rewrite_sql('SELECT n.*, u.name, u.uid FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] .' ORDER BY n.changed DESC'), 50, 0, NULL, $filter['args']);
+  }

   $form['options'] = array('#type' => 'fieldset',
     '#title' => t('Update options'),
