##// 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 is_repo_comment = comment.repo.repo_id == self.db_repo.repo_id
674 is_repo_comment = comment.repo.repo_id == self.db_repo.repo_id
675 comment_repo_admin = is_repo_admin and is_repo_comment
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 if super_admin or comment_owner or comment_repo_admin:
681 if super_admin or comment_owner or comment_repo_admin:
678 CommentsModel().delete(comment=comment, auth_user=self._rhodecode_user)
682 CommentsModel().delete(comment=comment, auth_user=self._rhodecode_user)
679 Session().commit()
683 Session().commit()
@@ -1748,6 +1748,10 b' class RepoPullRequestsView(RepoAppView, '
1748 is_repo_comment = comment.repo.repo_name == self.db_repo_name
1748 is_repo_comment = comment.repo.repo_name == self.db_repo_name
1749 comment_repo_admin = is_repo_admin and is_repo_comment
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 if super_admin or comment_owner or comment_repo_admin:
1755 if super_admin or comment_owner or comment_repo_admin:
1752 old_calculated_status = comment.pull_request.calculated_review_status()
1756 old_calculated_status = comment.pull_request.calculated_review_status()
1753 CommentsModel().delete(comment=comment, auth_user=self._rhodecode_user)
1757 CommentsModel().delete(comment=comment, auth_user=self._rhodecode_user)
General Comments 0
You need to be logged in to leave comments. Login now