From c311a4f88dcd424dfd4ff1917483d3efa559c6cc Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Wed, 1 Dec 2010 06:34:05 +0000 Subject: [PATCH] Check for the 'review comments' permission instead of 'manage' to decide if the user should see a 'this comment is pending' message. svn path=/plone.app.discussion/trunk/; revision=46050 --- CHANGES.txt | 4 ++++ plone/app/discussion/browser/comments.py | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 750c38f..74490b6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,10 @@ Changelog 1.0RC1 (unreleased) ------------------- +- Check for the 'review comments' permission instead of 'manage' to decide + if the user should see a 'this comment is pending' message. + [timo] + - Move "moderate comments" site action above the logout action. [timo] diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index 880269c..ad10eed 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -218,11 +218,12 @@ class CommentForm(extensible.ExtensibleForm, form.Form): # If a user posts a comment and moderation is enabled, a message is # shown to the user that his/her comment awaits moderation. If the user - # has manage right, he/she is redirected directly to the comment. - can_manage = getSecurityManager().checkPermission('Manage portal', + # has 'review comments' permission, he/she is redirected directly + # to the comment. + can_review = getSecurityManager().checkPermission('Review comments', context) comment_review_state = wf.getInfoFor(comment, 'review_state') - if comment_review_state == 'pending' and not can_manage: + if comment_review_state == 'pending' and not can_review: # Show info message when comment moderation is enabled IStatusMessage(self.context.REQUEST).addStatusMessage( _("Your comment awaits moderator approval."),