Skip to content

Add REST API endpoints to list, create, delete instance member roles

Hinam Mehra requested to merge 452208-member-roles-rest-api-for-instance into master

What does this MR do and why?

  • Add REST API endpoints to list, create, delete instance-level member roles.
  • As the name suggests, instance-level member roles are created for the entire instance by admins and have namespace_id: nil

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Ensure SaaS mode is turned off with export GITLAB_SIMULATE_SAAS=0
  2. Log-in as an admin and create a personal access token with api scope on /-/user_settings/personal_access_tokens
  3. Using the token - list, create & delete instance-level member roles:
GET /api/v4/member_roles

POST /api/v4/member_roles
{ "name": "Guest + read_code", "description": "Repository access", "read_code": true, "base_access_level": 10 }

DELETE /api/v4/member_roles/:id

Related to #452208 (closed)

Edited by Hinam Mehra

Merge request reports

Loading