Replace the can_manage method with a can_review method that checks the 'Review comments' permission. This fixes http://dev.plone.org/plone/ticket/11145.
svn path=/plone.app.discussion/trunk/; revision=40534
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
<tal:block define="userHasReplyPermission view/can_reply;
|
||||
isAnonymousDiscussionAllowed view/anonymous_discussion_allowed;
|
||||
isAnon view/is_anonymous;
|
||||
canManage view/can_manage;
|
||||
replies python:view.get_replies(canManage);
|
||||
has_replies python:view.has_replies(canManage);
|
||||
canReview view/can_review;
|
||||
replies python:view.get_replies(canReview);
|
||||
has_replies python:view.has_replies(canReview);
|
||||
showCommenterImage view/show_commenter_image;
|
||||
errors options/state/getErrors|nothing;
|
||||
wtool context/@@plone_tools/workflow;">
|
||||
@@ -38,7 +38,7 @@
|
||||
tal:attributes="class python:'comment replyTreeLevel'+str(depth)+' state-'+str(review_state);
|
||||
style string:margin-left: ${depth}em;
|
||||
id string:${reply/getId}"
|
||||
tal:condition="python:canManage or review_state == 'published'">
|
||||
tal:condition="python:canReview or review_state == 'published'">
|
||||
|
||||
<div class="commentImage" tal:condition="showCommenterImage">
|
||||
<a href="" tal:condition="has_author_link"
|
||||
@@ -87,7 +87,7 @@
|
||||
action=""
|
||||
method="post"
|
||||
style="display: inline;"
|
||||
tal:condition="canManage"
|
||||
tal:condition="canReview"
|
||||
tal:attributes="action string:${reply/absolute_url}/@@moderate-delete-comment">
|
||||
<input name="form.button.DeleteComment"
|
||||
class="destructive"
|
||||
@@ -102,7 +102,7 @@
|
||||
action=""
|
||||
method="get"
|
||||
style="display: inline;"
|
||||
tal:condition="canManage"
|
||||
tal:condition="canReview"
|
||||
tal:repeat="action reply_dict/actions|nothing"
|
||||
tal:attributes="action string:${reply/absolute_url}/@@moderate-publish-comment;
|
||||
name action/id">
|
||||
|
||||
@@ -241,13 +241,17 @@ class CommentsViewlet(ViewletBase):
|
||||
mimetype=mimetype).getData()
|
||||
|
||||
def can_reply(self):
|
||||
"""Returns true if current user has the 'Reply to item' permission.
|
||||
"""
|
||||
return getSecurityManager().checkPermission('Reply to item',
|
||||
aq_inner(self.context))
|
||||
|
||||
def can_manage(self):
|
||||
return getSecurityManager().checkPermission('Manage portal',
|
||||
def can_review(self):
|
||||
"""Returns true if current user has the 'Review comments' permission.
|
||||
"""
|
||||
return getSecurityManager().checkPermission('Review comments',
|
||||
aq_inner(self.context))
|
||||
|
||||
|
||||
def is_discussion_allowed(self):
|
||||
context = aq_inner(self.context)
|
||||
conversation = IConversation(context)
|
||||
|
||||
Reference in New Issue
Block a user