Skip to content

Show indicator for projects created and owned by banned users

Eugie Limpin requested to merge el-hidden-banned-user-project-indicator into master

What does this MR do and why?

Partially resolves https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/work_items/397

Display hidden resource icon instead of visibility level icon for projects created and owned by banned users. Since these projects are hidden, the indicator will only show for admin users.

Screenshots or screen recordings

Page Before After
Project show page Screenshot_2023-07-20_at_2.24.41_PM Screenshot_2023-07-20_at_2.20.38_PM
Projects list page Screenshot_2023-07-20_at_2.24.20_PM Screenshot_2023-07-20_at_2.21.10_PM
Group settings projects page Screenshot_2023-07-20_at_2.25.09_PM Screenshot_2023-07-20_at_2.19.02_PM
Admin project page Screenshot_2023-07-20_at_2.25.27_PM Screenshot_2023-07-20_at_2.19.48_PM

How to set up and validate locally

Note: In the URLs below, replace (username) with the username of the user in (2), (project-slug) with the project slug created in (3), and group-slug with the group slug created in (4)

Example: group slug Screenshot_2023-07-20_at_2.59.21_PM
  1. Enable the feature flag
    $ rails c
    > Feature.enable(:hide_projects_of_banned_users)
    => true
  2. Create a non-admin user or use an existing one
  3. Create a personal public project (under the user namespace not a group)
  4. Create a public group then create a public project under that group
  5. Login with an admin account (root)
  6. Go to http://localhost:3000/admin/users/(username). Ban the user.
  7. Go to http://localhost:3000/ and search for your project. Validate that the correct icon with a tooltip is displayed (see screenshots above).
  8. Go to the project page: http://localhost:3000/(username)/(project-slug). Validate that the correct icon with a tooltip is displayed (see screenshots above).
  9. Go to the admin project page: http://localhost:3000/admin/projects/(username)/(project-slug). Validate that the correct icon with a tooltip is displayed (see screenshots above).
  10. Go to the group settings projects page for the project created in (4): http://localhost:3000/groups/(group-slug)/-/projects. Validate that the correct icon with a tooltip is displayed (see screenshots above).

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 Eugie Limpin

Merge request reports