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
This commit is contained in:
Timo Stollenwerk 2010-12-01 06:34:05 +00:00
parent 19f0666b39
commit c311a4f88d
2 changed files with 8 additions and 3 deletions

View File

@ -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]

View File

@ -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."),