Skip to content

Draft: Add UI to trust/untrust a user

Ethan Urie requested to merge eurie-add-ui-for-allowing-possible-spam into master

What does this MR do and why?

UI-side follow-up to !123430 (merged) and part of https://gitlab.com/gitlab-org/gl-security/security-engineering/security-automation/spam/spamcheck/-/issues/17

Adds UI elements to allow admins to trust/untrust users for purposes of creating issues, notes, snippets, etc. that are detected to be possible spam.

We use UserCustomAttributes to indicate when a user is trusted to create possible spam. These UI changes expose that capability to admin users in the user admin panel and the abuse report dashboard.

Screenshots or screen recordings

Before After
Screenshot_2023-08-29_at_4.41.42_PM Screenshot_2023-07-13_at_4.36.22_PM
Screenshot_2023-08-29_at_4.41.42_PM Screenshot_2023-07-13_at_4.36.36_PM
Screenshot_2023-08-29_at_4.41.23_PM Screenshot_2023-07-17_at_1.47.56_PM
Screenshot_2023-08-29_at_9.25.47_PM Screenshot_2023-08-30_at_4.37.32_PM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Log into your GDK as an admin
  2. Visit /admin/users and ensure there's a Trusted tab
  3. Visit /admin/spam_logs
  4. Ensure there's a Trust user button on each row
  5. Click the Trust user button on one spam log and note the user
  6. Revisit /admin/users?filter=trusted
  7. Ensure the newly trusted user is there and that there's an Untrust user action available in the dropdown menu.
  8. Click the Untrust user button and confirm the action
  9. Ensure that the user no longer shows up in the Trusted tab
  10. Visit /admin/abuse_reports
  11. Select the first report
  12. Click the Actions button
  13. Select Trust user
  14. Verify that the user now appears in the Trusted tab in /admin/users
  15. Repeat steps 10-14 but also check the Close report checkbox and verify the Abuse report is closed in /admin/abuse_reports

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

!
Edited by Ethan Urie

Merge request reports