##// END OF EJS Templates
comments: forbig removal of comments by anyone except the owners.
milka -
r4643:6f8e3276 default
parent child Browse files
Show More
@@ -674,6 +674,10 b' class RepoCommitsView(RepoAppView):'
674 674 is_repo_comment = comment.repo.repo_id == self.db_repo.repo_id
675 675 comment_repo_admin = is_repo_admin and is_repo_comment
676 676
677 if comment.draft and not comment_owner:
678 # We never allow to delete draft comments for other than owners
679 raise HTTPNotFound()
680
677 681 if super_admin or comment_owner or comment_repo_admin:
678 682 CommentsModel().delete(comment=comment, auth_user=self._rhodecode_user)
679 683 Session().commit()
@@ -1748,6 +1748,10 b' class RepoPullRequestsView(RepoAppView, '
1748 1748 is_repo_comment = comment.repo.repo_name == self.db_repo_name
1749 1749 comment_repo_admin = is_repo_admin and is_repo_comment
1750 1750
1751 if comment.draft and not comment_owner:
1752 # We never allow to delete draft comments for other than owners
1753 raise HTTPNotFound()
1754
1751 1755 if super_admin or comment_owner or comment_repo_admin:
1752 1756 old_calculated_status = comment.pull_request.calculated_review_status()
1753 1757 CommentsModel().delete(comment=comment, auth_user=self._rhodecode_user)
General Comments 0
You need to be logged in to leave comments. Login now