SAML API incorrectly responds with "access_level does not have a valid value"

Summary

The SAML API gives back a 400 bad request with error "access_level does not have a valid value" when calling /groups/:id/saml_group_links on a top-level group with access_level 5 (Minimal Access).

As per the documentation this is a valid value for top-level groups: https://docs.gitlab.com/user/permissions/#roles

The SAML group links GUI does allow you to set the link with access level Minimal Access.

Steps to reproduce

  1. Create a top-level group.
  2. Send a POST request to the /groups/:id/saml_group_links API endpoint with the access_level field value set to 5. Using the ID of the top-level group.

Example Project

Error is only present on the API.

What is the current bug behavior?

Returns a 400 bad request with error.

What is the expected correct behavior?

Return a 201 created and create the SAML group link.

Relevant logs and/or screenshots

image

Edited by 🤖 GitLab Bot 🤖