diff --git a/app/models/comment.rb b/app/models/comment.rb index 80762cd34..9b77b4f0e 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -194,6 +194,10 @@ class Comment < ApplicationRecord ancestry && Comment.exists?(id: ancestry) end + def by_staff_account? + user == User.staff_account + end + def privileged_reaction_counts @privileged_reaction_counts ||= reactions.privileged_category.group(:category).count end diff --git a/app/policies/comment_policy.rb b/app/policies/comment_policy.rb index b7b483260..ab097c4e2 100644 --- a/app/policies/comment_policy.rb +++ b/app/policies/comment_policy.rb @@ -37,7 +37,7 @@ class CommentPolicy < ApplicationPolicy end def hide? - user_commentable_author? + user_commentable_author? && !record.by_staff_account? end alias unhide? hide? diff --git a/app/views/comments/_comment_header.html.erb b/app/views/comments/_comment_header.html.erb index ccc0ea540..fc6294d9d 100644 --- a/app/views/comments/_comment_header.html.erb +++ b/app/views/comments/_comment_header.html.erb @@ -31,23 +31,24 @@