Skip to content

Add PATCH /groups/:id/members/:user_id/member_role

Jessie Young requested to merge jy-patch-member-role into master

What does this MR do and why?

  • This EE-only API endpoint will be used to associate group members with custom roles.
  • We will want this for project members too but this endpoint is a good first iteration.
  • Custom roles functionality is still behind the customizable_roles feature flag
  • #383014 (closed)

Screenshots or screen recordings

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

How to set up and validate locally

  1. Enable the customizable_roles feature flag for the top-level group for which you are the owner and plan to create custom roles.
  2. Create the custom GUEST role for the group via the API:
     curl --request POST --header "Content-Type: application/json" --header "Authorization: Bearer $YOUR_ACCESS_TOKEN" --data '{"base_access_level":10, "download_code":1}' "http://localhost:3000/api/v4/groups/$GROUP_PATH/member_roles"
  3. Invite a test user account to the root group as a GUEST
  4. Associate membership with a custom role using the API endpoint added in this MR
     curl --request PATCH --header "Content-Type: application/json" --header "Authorization: Bearer $YOUR_ACCESS_TOKEN" --data '{"member_role_id":$MEMBER_ROLE_ID}' "http://localhost:3000/api/v4/groups/$GROUP_ID/members/$GUEST_USER_ID/member_role"

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 Jessie Young

Merge request reports

Loading