Accept `PermissionsEnum` in `Mutation.memberRoleCreate`
What does this MR do and why?
This change updates the Mutation.memberRoleCreate to accept an array of Types::MemberRoles::PermissionsEnum
instead of an array of String
. This ensures that only valid permissions can be provided as arguments to the mutation instead of arbitrary string values.
Related to:
Screenshots or screen recordings
How to set up and validate locally
- Visit the GraphQL explorer. (e.g. http://gdk.test:3000/-/graphql-explorer)
- Create a new role with the
permissions
argument.mutation createRole { memberRoleCreate( input: {groupPath: "flightjs", name: "example", description: "test role", permissions: [READ_VULNERABILITY], baseAccessLevel: GUEST} ) { errors memberRole { id name description readVulnerability enabledPermissions } } }
- Verify that the response includes the permission in the
enabledPermissions
field.{ "data": { "memberRoleCreate": { "errors": [], "memberRole": { "id": "gid://gitlab/MemberRole/7", "name": "example", "description": "test role", "readVulnerability": true, "enabledPermissions": [ "READ_VULNERABILITY" ] } } } }
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 mo khan