--- shoutbox.module.orig	2007-10-13 12:47:49.000000000 +0200
+++ shoutbox.module	2007-10-13 13:27:09.000000000 +0200
@@ -359,10 +359,10 @@
   global $user;
 
   $links = theme('shoutbox_links'); // get array of links
-  if (shoutbox_user_access('edit own shouts', $shout)) {
+  if (shoutbox_user_access('edit own shouts', $shout) || shoutbox_user_access('administer shoutbox', $shout)) {
     $shoutlinks[] = $links['edit'];
   }
-  if (shoutbox_user_access('delete own shouts', $shout)) {
+  if (shoutbox_user_access('delete own shouts', $shout) || shoutbox_user_access('administer shoutbox', $shout)) {
     $shoutlinks[] = $links['delete'];
   }
   if (shoutbox_user_access('moderate shoutbox', $shout)) {
@@ -405,7 +405,7 @@
   }
   else {
     $shout = db_fetch_object(db_query('SELECT * FROM {shoutbox} WHERE shout_id = %d', $shout_id));
-    if(shoutbox_user_access('delete own shouts', $shout)) {
+    if(shoutbox_user_access('delete own shouts', $shout) || shoutbox_user_access('administer shoutbox', $shout)) {
       
       $output .= theme('shoutbox_post',$shout);
       
@@ -649,7 +649,7 @@
       '#options' => $users,
     );
   }
-  if(shoutbox_user_access('edit own shouts', $shout)) {      
+  if(shoutbox_user_access('edit own shouts', $shout) || shoutbox_user_access('administer shoutbox', $shout)) {      
       if (!variable_get(shoutbox_shownamefield, 1) && $user->uid) {
 	$form['nick'] = array(
 	  '#type' => 'hidden',
@@ -684,6 +684,10 @@
         '#type' => 'hidden',
         '#value' => $shout->shout_id,
       );
+      $form['status'] = array(
+        '#type' => 'hidden',
+	'#value' => 1,
+      );
     }
     
     $form[] = array('#type' => 'submit', '#value' => t('Update'));
@@ -750,7 +754,7 @@
 function shoutbox_delete_form_submit($form_id, $form_values) {
   $result = db_query("SELECT * FROM {shoutbox} WHERE shout_id = '%d'", $form_values['shout_id']);
   if ($shout = db_fetch_object($result)) {
-    if (shoutbox_user_access('delete own shouts', $shout)) {
+    if (shoutbox_user_access('delete own shouts', $shout) || shoutbox_user_access('administer shoutbox', $shout)) {
       db_query("DELETE FROM {shoutbox} WHERE shout_id ='%d'",
                $form_values['shout_id']);
       drupal_set_message(t('Your shout was deleted.'));
@@ -833,7 +837,7 @@
   $user_timeout = false;
   $user_owned = false;
   
-  if (user_access('administer shoutbox')) {
+  if ($permission == 'administer shoutbox' && user_access('administer shoutbox')) {
     return 1;
   } elseif (!user_access($permission)) { // if user_access says no, it's definitely no.
     return 0; 
@@ -862,6 +866,8 @@
           if (!($votecheck = db_fetch_object($result))) { // .. and if the user has not yet voted
             return 1; // allow moderation
           }
+        } else {
+	  return 1;
         }
       //}
     }
