[drupal-devel] [bug] 'administer nodes' should be 'administer comments'

ejort drupal-devel at drupal.org
Wed Jul 20 01:02:53 UTC 2005

Issue status update for 
Post a follow up: 

 Project:      Drupal
 Version:      cvs
 Component:    comment.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  ejort
 Updated by:   ejort
 Status:       patch

This patch still applies, and the problem is still present.  Anybody
care to fix this? I'm lazy and want to minimise my diffs to the
mainline drupal  (even if it is just changing one word)  :-)



Previous comments:

Sun, 19 Jun 2005 05:47:20 +0000 : ejort

Attachment: http://drupal.org/files/issues/comment.module.remove_administer_nodes.patch (810 bytes)


In the validate case in comment_nodeapi, there is currently the

      if (!user_access('administer nodes')) {
        // Force default for normal users:
        $node->comment = variable_get("comment_$node->type",

The check for 'adminster nodes' should instead be for 'administer
comments'.  As seen in the 'form admin' case, the comment options are
only output if the user has 'administer comments' permission:

      if (user_access('administer comments')) {
        $selected = isset($node->comment) ? $node->comment :
variable_get("comment_$node->type", 2);
        $output = form_radios('', 'comment', $selected,
array(t('Disabled'), t('Read only'), t('Read/write')));
        return form_group(t('User comments'), $output);

So, the bug I ran into was with users who had 'administer nodes' but
not 'administer comments' permission.  Everything was posted with
comments disabled (the validate case DIDN'T force comments to the
default, but neither were they given an option to select anything). 
This one line patch fixes the issue.

This is present in 4.6 (where I discovered it) and in HEAD.



Tue, 28 Jun 2005 03:41:32 +0000 : ejort

Can anybody confirm or deny this issue?


Wed, 29 Jun 2005 22:38:38 +0000 : ricmadeira

Yes, I can confirm it! I have had this same problem since I started
using Drupal (from 4.5.2 onwards); I was just too stupid to file a bug

Please include this fix with the next release. Drupal 4.6.2 doesn't
have it yet (I just tested it) so I have to patch it manually again.

More information about the drupal-devel mailing list