--- modr8.module.orig 2008-10-21 17:50:16.000000000 +0200 +++ modr8.module 2009-05-09 19:13:03.000000000 +0200 @@ -76,7 +76,7 @@ * Implementation of hook_perm(). */ function modr8_perm() { - return array('moderate content'); + return array('moderate content','bypass moderation'); } /** @@ -167,9 +167,18 @@ case 'prepare': if (!isset($node->nid)) {//a new node $node_options = variable_get('node_options_'. $node->type, array('status', 'promote')); - $node->moderate = in_array('moderate', $node_options); + $node->moderate = in_array('moderate', $node_options) && !user_access('bypass moderation'); } break; + + case 'submit': + if ($node->moderate && user_access('bypass moderation')) { + if (!user_access('administer nodes')) { // Don't reset for admins + $node->moderate = 0; + } + } + break; + case 'view': if ($node->moderate && empty($node->modr8_form_teaser) && empty($node->in_preview) && ($teaser || $page)) { $node->content['modr8_message'] = array( @@ -339,7 +348,9 @@ drupal_set_message(t("The post has been submitted for moderation and won't be listed publicly until it has been approved."), 'warning'); break; case 'node_form': - drupal_set_message(t('This %type will be submitted for moderation and will not be accessible to other users until it has been approved.', array('%type' => node_get_types('name', $nodetype)))); + if (!user_access('bypass moderation')) { + drupal_set_message(t('This %type will be submitted for moderation and will not be accessible to other users until it has been approved.', array('%type' => node_get_types('name', $nodetype)))); + } break; } return '';