Skip to content

Hide "New merge request" button from Auditors on "Code review" page

📖 What does this MR do?

Related to #324974 (closed)

Hides "New merge request" button from Auditors on "Project" -> "Analytics" -> "Code Review" page. Auditors have read-only access to all projects on the GitLab instance so clicking that button returns a 404.

As a side effect of this change the "New merge request" button is also hidden for logged out users. Previously it would return a 404 if a logged out user clicked it.

💻 Local testing

  1. Log in with an admin account (root)
  2. Navigate to /admin/users/new
  3. Fill out required fields and choose "Auditor" in the "Access level"
  4. Create a new project
  5. Log out and then log in with newly create Auditor account
  6. Navigate to newly created project -> "Analytics" -> "Code Review"

📷 Screenshots

View Before After
Auditor that is not a member of project Screen_Shot_2021-03-18_at_2.23.33_PM Screen_Shot_2021-03-18_at_2.15.38_PM
Logged out user Screen_Shot_2021-03-18_at_2.26.08_PM Screen_Shot_2021-03-18_at_2.17.01_PM

Below screenshots should be the same

View Before After
Auditor that is member of project Screen_Shot_2021-03-18_at_2.23.46_PM Screen_Shot_2021-03-18_at_2.15.55_PM
Regular user that is member of project Screen_Shot_2021-03-18_at_2.24.07_PM Screen_Shot_2021-03-18_at_2.16.29_PM

🚦 Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Peter Hegman

Merge request reports

Loading