Skip to content

Add ability to Trust and Untrust a user from the users admin panel

What does this MR do and why?

Follow up to !131812 (merged) and !131102 (merged)

This adds a Trusted users tab to the users admin panel as well as the ability to trust/untrust a user on that panel via the actions drop-down.

Trusted users can create issues, snippets, and notes that are not checked for spam. By default, a user is not trusted.

Database

There are 2 new queries, the first is here in User.

The query plan for that is here

The second query is here in Admin::UsersController

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2023-08-29_at_4.42.13_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

How to set up and validate locally

  1. Log into your GDK as an admin
  2. Visit /admin/users and ensure there's a Trusted tab
  3. On the "Active" tab, click the action menu (3 vertical dots) on the right side of the row for a given user, select "Trust user" and confirm
  4. Go to the "Trusted" tab (/admin/users?filter=trusted)
  5. Ensure the newly trusted user is there and that there's an Untrust user action available in the dropdown action menu.
  6. Click the Untrust user button and confirm the dialog
  7. Ensure that the user no longer shows up in the Trusted tab

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