As part of work for one of my clients, I've created a module that allows you to select users that are allowed to comment on a specific node.

The new module adds a new tab on the node page.

It depends on a small patch to comment_perm. I'm requesting that this be included into comment_perm.

diff -wBNru comment_perm/comment_perm.module modules/comment_perm/comment_perm.module
--- comment_perm-orig/comment_perm.module	2009-11-10 17:16:40.000000000 -0500
+++ comment_perm-new/comment_perm.module	2010-03-19 02:18:11.000000000 -0400
@@ -178,6 +178,13 @@
       return TRUE;
     }
 
+    $results = module_invoke_all('comment_perm_access', array('node' => $node, 'account' => $user));
+    foreach($results as $result) {
+        if ($result === TRUE) {
+            return TRUE;
+        }
+    }
+
     // comment_perm controlled node types default to no permissions
     return FALSE;
   }

Comments

pluess’s picture

Category: task » feature

I might be interested in your custom module to integrate parts of it. Could you post your custom module?

fizk’s picture

Sorry, I don't have access to that module anymore.

pluess’s picture

Status: Active » Closed (won't fix)

Bad luck. So I'm closing this for now.

fizk’s picture

Status: Closed (won't fix) » Active

This issue isn't about the module I wrote, but about adding the following patch to comment_perm:

diff -wBNru comment_perm/comment_perm.module modules/comment_perm/comment_perm.module
--- comment_perm-orig/comment_perm.module	2009-11-10 17:16:40.000000000 -0500
+++ comment_perm-new/comment_perm.module	2010-03-19 02:18:11.000000000 -0400
@@ -178,6 +178,13 @@
       return TRUE;
     }

+    $results = module_invoke_all('comment_perm_access', array('node' => $node, 'account' => $user));
+    foreach($results as $result) {
+        if ($result === TRUE) {
+            return TRUE;
+        }
+    }
+
     // comment_perm controlled node types default to no permissions
     return FALSE;
   }