FEATURE - allow Group Moderators to edit category description (#10292)

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
This commit is contained in:
jbrw
2020-07-23 09:50:00 -04:00
committed by GitHub
parent 61d3640643
commit 2aec92d0b4
8 changed files with 112 additions and 2 deletions

View File

@ -192,8 +192,13 @@ class PostRevisor
PostLocker.new(@post, @editor).lock
end
# We log staff edits to posts
if @editor.staff? && @editor.id != @post.user_id && @fields.has_key?('raw') && !@opts[:skip_staff_log]
# We log staff/group moderator edits to posts
if (
(@editor.staff? || (@post.is_category_description? && Guardian.new(@editor).can_edit_category_description?(@post.topic.category))) &&
@editor.id != @post.user_id &&
@fields.has_key?('raw') &&
!@opts[:skip_staff_log]
)
StaffActionLogger.new(@editor).log_post_edit(
@post,
old_raw: old_raw