Add API to change membership state
What does this MR do and why?
This API will be used for the Usage Quota page to toggle the membership
state on free groups. It changes the membership states for all related
memberships of a user to the given group to either active
or
awaiting
.
It will be used to implement the toggle for https://gitlab.com/gitlab-org/gitlab/-/issues/352638
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
- Get an access token http://localhost:3000/-/profile/personal_access_tokens
- Start the gdk with
export GITLAB_SIMULATE_SAAS=1 gdk start
- Find a group that you want to experiment with - make sure that the Group has a
free
ordefault
plang = Group.find(153)
- Execute the curl request for a user within the group
curl --request PUT --header "PRIVATE-TOKEN: TOKEN" "http://localhost:3000/api/v4/groups/GROUP_ID/billable_members/USER_ID/activate" curl --request PUT --header "PRIVATE-TOKEN: TOKEN" "http://localhost:3000/api/v4/groups/GROUP_ID/billable_members/USER_ID/deactivate"
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Nicolas Dular