FEATURE: Log Staff edits in Staff Action Logs

Why? Some edits by staff are not tracked. For example, during the grace
period, or via the flags/silence dialog.

If a staff member is editing someone else's post, it now goes into the
Staff Action Logs so it can be audited by other staff members.
This commit is contained in:
Robin Ward
2018-03-12 13:51:40 -04:00
parent 82143a421c
commit 65ac80b014
6 changed files with 72 additions and 4 deletions
+8
View File
@@ -177,6 +177,14 @@ 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')
StaffActionLogger.new(@editor).log_post_edit(
@post,
new_raw: @fields['raw']
)
end
# WARNING: do not pull this into the transaction
# it can fire events in sidekiq before the post is done saving
# leading to corrupt state