Log more admin actions

AI-generated summary

Log more admin actions

vchuravy noticed some admin actions are not audited, such as locking/unlocking user trust levels. jomaxro highlighted additional issues:

  • System blocks lack context
  • Delete post actions have no context (self-deleted posts)
  • Delete user reveals email address (also occurs with revoke email)
  • Separate logs for the same event (spam topic/user)

codinghorror prioritized adding context to logs, and neil added it to his list. neil later confirmed that he handled the mentioned issues, including:

  • Logging lock/unlock trust level
  • Logging activate/deactivate user
  • Adding context for deleted posts
  • Stopping email address display for deleted users
  • Stopping email address display for revoked email

However, erlend_sh still saw system deletions with empty descriptions, which was later confirmed by codinghorror to be due to email staged users. zogstrip fixed the issue and confirmed the fix.

I just noted that a few admin/moderator actions are not audited.
As an example Lock/Unlock user to Trust Level isn’t, but probably should be.

8 лайков

While we’re on the subject…

Blocks by the system user don’t have any context:

Delete post has no context (self-deleted in these cases):

Delete user reveals email address:
https://meta.discourse.org/t/privacy-email-of-deleted-users-displayed-in-staff-logs/39324
Also occurs with revoke email.

3 separate logs for same event (spam topic/user):

4 лайка

Adding context should be a priority, @neil can you add to your list.

3 лайка

Yeah we should definitely try to include context whenever we add something in those logs. Added to my list.

8 лайков

I handled all the things mentioned in this topic.

  • log lock/unlock trust level
  • log activate/deactivate user
  • context added for deleted post because author deleted
  • stop displaying email addresses of deleted users. The screened emails list will show the emails of spammers/bad people.
  • stop displaying email address for revoked email (can be found on user record as usual)
12 лайков

Were you able to handle this too?

4 лайка

Yes the context will include something like “blocked by staff” and “too many flags”, from the reason for the block.

6 лайков

While we’re at it, I’ll take the liberty of bumping this:

2 лайка

Can you confirm we are good here @neil and @erlend_sh?

1 лайк

I’m still seeing some system deletions with empty descriptions, which is quite confusing:

3 лайка

Those look like email staged users to me, so system is perhaps cleaning up old staged users, can you confirm @zogstrip?

2 лайка

Confirmed :heavy_check_mark: and fixed :wink:

https://github.com/discourse/discourse/commit/4addc5e3297061d9a0e37b41c98024f50a31b50d

5 лайков