Index: revision_moderation.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/revision_moderation/revision_moderation.install,v
retrieving revision 1.5
diff -u -p -r1.5 revision_moderation.install
--- revision_moderation.install	31 Jul 2008 17:29:58 -0000	1.5
+++ revision_moderation.install	13 Aug 2008 22:04:54 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: revision_moderation.install,v 1.5 2008/07/31 17:29:58 westwesterson Exp $
+// $Id: revision_moderation.install,v 1.4 2007/12/18 03:14:40 webchick Exp $
 
 /**
  * Implementation of hook_schema().
@@ -46,3 +46,32 @@ function revision_moderation_uninstall()
   variable_del('revision_moderation_cron_more_than');
   variable_del('revision_moderation_cron_amount');
 }
+
+/**
+ * Switching bypass permission from administer nodes to a new permission
+ */
+function revision_moderation_update_1() {
+  $ret = array();
+  if (variable_get('revision_moderation_exempt', 1)) {
+    switch ($GLOBALS['db_type']) {
+      case 'mysql':
+      case 'mysqli':
+        $ret[] = update_sql("
+          UPDATE permission
+          SET perm = CONCAT(perm, ', bypass revision moderation')
+          WHERE perm LIKE '%administer nodes%'
+          ");
+        break;
+      case 'pgsql':
+        $ret[] = update_sql("
+          UPDATE permission
+          SET perm = CONCAT(perm, ', bypass revision moderation')
+          WHERE perm LIKE '%administer nodes%'
+          ");
+        break;
+    }
+  }
+  // Delete the old admin setting variable:
+  variable_del('revision_moderation_exempt');  
+  return $ret;
+}
\ No newline at end of file
Index: revision_moderation.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/revision_moderation/revision_moderation.module,v
retrieving revision 1.39
diff -u -p -r1.39 revision_moderation.module
--- revision_moderation.module	31 Jul 2008 17:29:58 -0000	1.39
+++ revision_moderation.module	13 Aug 2008 22:04:54 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: revision_moderation.module,v 1.39 2008/07/31 17:29:58 westwesterson Exp $
+// $Id: revision_moderation.module,v 1.38 2007/12/18 03:14:40 webchick Exp $
 
 /**
  * @file
@@ -72,12 +72,6 @@ function revision_moderation_admin_perm(
  * Menu callback; admin settings page.
  */
 function revision_moderation_settings() {
-  $form['revision_moderation_exempt'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Exempt administrators from revision moderation'),
-    '#default_value' => variable_get('revision_moderation_exempt', 1),
-    '#description' => t('With this option enabled, users with the "administer nodes" privilege will bypass the moderation system, and their revisions will be published immediately.'),
-  );
   $form['revision_moderation_cron'] = array(
     '#type' => 'fieldset',
     '#title' => t('Cron job'),
@@ -139,6 +133,14 @@ function revision_moderation_settings_va
 }
 
 /**
+ * Implementation of hook_perm().
+ *
+ */
+function revision_moderation_perm() {
+  return array('bypass revision moderation');
+}                                            
+
+/**
  * Implementation of hook_form_alter().
  */
 function revision_moderation_form_alter(&$form, $form_state, $form_id) {
@@ -233,8 +235,7 @@ function revision_moderation_nodeapi(&$n
   // Only do this logic for non-admin users on nodes with revision moderation
   // turned on.
   // And not editing a chose revision
-  if ($node->nid && $node->revision_moderation == 1 && arg(2) != 'revisions'
-    && (!user_access('administer nodes') || !variable_get('revision_moderation_exempt', 1))) {
+  if ($node->nid && $node->revision_moderation == 1 && (!user_access('bypass revision moderation'))) {
     switch ($op) {
       case 'prepare':
         // If user has a pending revision for this node, load the latest version of
