Skip to content

Update list user projects API for admins

Firdaws Farukh requested to merge projects-api-as-admin into master

What does this MR do and why?

Update the List user projects to display all user's personal projects when searching as an admin. This will disregard the min_access_level param since admins have the maximum access level in all projects.

Currently, searching as an admin with any min_access_level returns an empty result except the projects an admin is a member of. This is contrary to the expected behaviour since admins should be able to see all projects.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

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

  1. Create private projects in a normal user's namespace.
  2. Using an admin account, use the Projects API to list the user's projects. eg if 98 is the user's ID:
GET /api/v4/users/98/projects
  1. Expected result is a list of the user's personal projects but currently an empty list is returned.

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 Firdaws Farukh

Merge request reports

Loading