[drupal-devel] [task] Make posting permission more granular.

killes drupal-devel at drupal.org
Tue Feb 8 00:01:43 UTC 2005

 Project:      Drupal
 Version:      cvs
 Component:    comment.module
 Category:     tasks
 Priority:     normal
 Assigned to:  killes at www.drop.org
 Reported by:  killes at www.drop.org
 Updated by:   killes at www.drop.org
 Status:       patch

Yes, the patch is still needed.
The patch actually removes more code from node.module than it adds.
Both modules are essential to Drupal and some degree of interaction is
tolerable, I think. You can still disable comment.module withou any ill

killes at www.drop.org

Previous comments:

August 29, 2004 - 07:55 : killes at www.drop.org

Attachment: http://drupal.org/files/issues/node-access-comment.patch (5 KB)

There have been requests to private forums. I think the most
straightforward way to allow them is by extending the node_access hook.
The attached patch tries this. It assumes that my node object caching
patch got committed. Afterwards loading a node twice won't be a
performance issue anymore.
The patch is untested, I'd like to get feedback on the implementation.


August 31, 2004 - 17:53 : killes at www.drop.org

Attachment: http://drupal.org/files/issues/node-access-comment_0.patch (5.02 KB)

The patch is now tested.
I think this needs a better explanations: The patch isn't only for
forums (which still need some kind of taxonomy permissions) but applies
to all nodes. You can set individual nodes to be commentable through the
_access hook. This would be helpfull for a forum where only a selected
role should be allowed to post, but others should read the


September 4, 2004 - 09:57 : killes at www.drop.org

The patch has a small problem: 
We need either to move this check

if ($op == 'comment' && $node->comment == 2 && user_access('post
comments')) {
    return TRUE;

before the db query (and thus taking away a bit of the power from that
patch) or add a grant_comment column to the node_access table:
alter table node_access add grant_comment tinyint(1) unsigned NOT NULL
default '0';


September 5, 2004 - 11:42 : killes at www.drop.org

Attachment: http://drupal.org/files/issues/node-access-comment_0_0.patch (4.78 KB)

Keeping up with CVS. I'd like to receive some feedback on the resolution
of the problme mentioned above.


September 13, 2004 - 03:25 : killes at www.drop.org

Attachment: http://drupal.org/files/issues/module_0.patch (7.1 KB)

Keeping up with cvs. Node modules should implement _access('comment').


September 14, 2004 - 07:38 : killes at www.drop.org

Attachment: http://drupal.org/files/issues/commentable.patch (7.89 KB)

Had forgotten blog.module


February 5, 2005 - 01:19 : Steven

Is this patch still needed? Doesn't it tie comment.module unnecessarily
into node.module?

View: http://drupal.org/node/10426
Edit: http://drupal.org/project/comments/add/10426

More information about the drupal-devel mailing list