Skip to content
Snippets Groups Projects
Commit 22a9f1384610 authored by Sandrine Ribeau's avatar Sandrine Ribeau
Browse files

[action] ticket #493227, only authenticated user should be able to delete a

         comment if it has the permission to do it
parent 07509c3a1b71
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,8 @@
from cubicweb.selectors import (one_line_rset, but_etype, implements,
has_permission, relation_possible, yes,
match_kwargs, score_entity)
match_kwargs, score_entity,
authenticated_user)
from cubicweb.view import EntityView
from cubicweb.common.uilib import rql_for_eid, cut, safe_cut
from cubicweb.common.mixins import TreeViewMixIn
......@@ -319,6 +320,7 @@
class DeleteCommentAction(Action):
id = 'delete_comment'
__select__ = implements('Comment') & \
authenticated_user() & \
score_entity(lambda x: not x.reverse_comments and x.has_perm('delete'))
title = _('delete comment')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment