Add Additional Error Messages When Minimal Access Role is Not Available

What does this MR do and why?

Solves Issue #331012 (closed)

The changed code adds the errors below to the existing "is not included in the list" message:

  • supported on top level group only - if adding a user with minimal access to a subgroup
  • not supported by all license types - if minimal access is not supported by the current license

This MR is an extended from this community contribution !62044 (closed)

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

curl --request PUT --header "PRIVATE-TOKEN: $GL_TOKEN" "http://localhost:3000/api/v4/groups/126/members/17?access_level=5"
{"message":{"access_level":["is not included in the list","not supported by all license types"]}}

curl --request POST --header "PRIVATE-TOKEN: $GL_TOKEN" "http://localhost:3000/api/v4/groups/126/members?user_id=18&access_level=5"
{"message":{"access_level":["is not included in the list","not supported by all license types"]}}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Abdul Wadood

Merge request reports

Loading