Add a GraphQL mutation for updating `OrganizationUser`
What does this MR do and why?
This change introduces a new GraphQL mutation for updating
OrganizationUser
. The mutation is restricted for use by
organization owners only. The access level can be set to either
OWNER
or DEFAULT
. To prevent organizations from being left
without an owner, the role of the last owner cannot be changed.
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
- Go to https://gdk.test:3000/-/graphql-explorer.
- Grab an organization user ID from the rails console:
Organizations::OrganizationUser.last
. - Run the following mutation. You can change the access level to
DEFAULT
orOWNER
:
mutation {
organizationUserUpdate(
input: {id: "gid://gitlab/Organizations::OrganizationUser/5", accessLevel: OWNER}
) {
clientMutationId
organizationUser {
id
accessLevel {
integerValue
stringValue
}
}
}
}
Related to #478031 (closed)