Skip to content

Commit

Permalink
Avoid self moderating/unmoderating comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hellcp-work authored and danidoni committed Oct 2, 2023
1 parent 02b968d commit 86327d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/api/app/policies/comment_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def reply?
# Only logged-in Admins/Staff members or user with moderator role can moderate comments
def moderate?
return false if record.user.is_nobody? # soft-deleted comments
return false if user == record.user
return true if user.try(:is_moderator?) || user.try(:is_admin?) || user.try(:is_staff?)

false
Expand Down

0 comments on commit 86327d2

Please sign in to comment.