[BE] For memberRoleCreate mutation, improve error message and prevent role from being created if group does not exist
When the GitLab instance is in self-managed mode, we no longer allow group-level custom roles to be created. However, the memberRoleCreate
mutation has several issues:
- When passing a
groupPath
for a group that exists, the error message returned is confusing because it says "the resource that you are attempting to access does not exist":
![]() |
- When passing a
groupPath
for a group that does not exist, the custom role is successfully created. backend is only throwing the error when the group exists, but treats non-existent groups the same as ifgroupPath
wasn't provided:
![]() |
- The REST API at
http://{server}/api/v4/groups/{group_id}/member_roles
still allows custom roles to be created for a group.
We should make the following changes (see tasks)
Edited by Jarka Košanová