From 2c225982038a53bf432c4d60fd6468b8811340c9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 20 Jul 2010 02:05:13 +0000 Subject: [PATCH] - Patch #364159 by David_Rothstein, MichaelCole, rszrama, ergonlogic: enable 'access comments' permission for anonymous users by default. --- modules/comment/comment.test | 7 ++++++- profiles/standard/standard.install | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/comment/comment.test b/modules/comment/comment.test index cf5376fec39..54a39bf0135 100644 --- a/modules/comment/comment.test +++ b/modules/comment/comment.test @@ -1022,11 +1022,16 @@ class CommentBlockFunctionalTest extends CommentHelperCase { $comment2 = $this->postComment($this->node, $this->randomName(), $this->randomName()); $comment3 = $this->postComment($this->node, $this->randomName()); - // Test that a user without the 'access comments' permission can not see the block. + // Test that a user without the 'access comments' permission cannot see the + // block. $this->drupalLogout(); + user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access comments')); $this->drupalGet(''); $this->assertNoText($block['title'], t('Block was not found.')); + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access comments')); + // Test that a user with the 'access comments' permission can see the + // block. $this->drupalLogin($this->web_user); $this->drupalGet(''); $this->assertText($block['title'], t('Block was found.')); diff --git a/profiles/standard/standard.install b/profiles/standard/standard.install index bae5a19e39a..45978df2d37 100644 --- a/profiles/standard/standard.install +++ b/profiles/standard/standard.install @@ -398,7 +398,7 @@ function standard_install() { // Enable default permissions for system roles. $filtered_html_permission = filter_permission_name($filtered_html_format); - user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', $filtered_html_permission)); + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', 'access comments', $filtered_html_permission)); user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'post comments without approval', $filtered_html_permission)); // Create a default role for site administrators, with all available permissions assigned.