Index: mollom.api.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.api.php,v
retrieving revision 1.6
diff -u -p -r1.6 mollom.api.php
--- mollom.api.php	12 Sep 2010 22:05:55 -0000	1.6
+++ mollom.api.php	23 Sep 2010 16:07:54 -0000
@@ -230,8 +230,8 @@
  *     Note that forms that specify 'entity' also need to specify 'post_id' in
  *     the 'mapping' (see below).
  *   - report access callback: (optional) A function name to invoke to check
- *     access to Mollom's dedicated "report to Mollom" form, which should return
- *     either TRUE or FALSE (like any other menu "access callback").
+ *     whether the current user is allowed to "report to Mollom", which should
+ *     return either TRUE or FALSE (like menu access callbacks).
  *   - report access: (optional) A list containing user permission strings, from
  *     which the current user needs to have at least one. Should only be used if
  *     no "report access callback" was defined.
Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.83
diff -u -p -r1.83 mollom.module
--- mollom.module	20 Sep 2010 03:39:10 -0000	1.83
+++ mollom.module	23 Sep 2010 16:34:56 -0000
@@ -645,10 +645,27 @@ function mollom_form_alter(&$form, &$for
   }
   // Integrate with delete confirmation forms to send feedback to Mollom.
   if (isset($forms['delete'][$form_id])) {
-    mollom_data_delete_form_alter($form, $form_state);
-    // Report before deleting. This needs to be handled here, since
-    // mollom_data_delete_form_alter() is re-used for mass-operation forms.
-    array_unshift($form['#submit'], 'mollom_data_delete_form_submit');
+    // Check whether the user is allowed to report to Mollom. Limiting report
+    // access is optional for forms integrating via 'delete form' and allowed by
+    // default, since we assume that users being able to delete entities are
+    // sufficiently trusted to also report to Mollom.
+    $access = TRUE;
+    // Check access, if there is a 'report access' permission list.
+    if (isset($forms['delete'][$form_id]['report access'])) {
+      $access = FALSE;
+      foreach ($forms['delete'][$form_id]['report access'] as $permission) {
+        if (user_access($permission)) {
+          $access = TRUE;
+          break;
+        }
+      }
+    }
+    if ($access) {
+      mollom_data_delete_form_alter($form, $form_state);
+      // Report before deleting. This needs to be handled here, since
+      // mollom_data_delete_form_alter() is re-used for mass-operation forms.
+      array_unshift($form['#submit'], 'mollom_data_delete_form_submit');
+    }
   }
 }
 
@@ -704,7 +721,7 @@ function mollom_form_cache($reset = FALS
       // A delete confirmation form integration requires a 'post_id' mapping.
       $form_info = mollom_form_info($form_id, $info['module']);
       if (isset($form_info['mapping']['post_id'])) {
-        $forms['delete'][$info['delete form']] = $form_id;
+        $forms['delete'][$info['delete form']] = $info;
       }
     }
   }
