How to disable ability to create Git Groups for users (by default)

Hello,

I have an existing GitLab user base of 500+, they are authenticated via LDAP. Company may also have new users who join in. When a user logs into GitLab the first time, they will have a user entry in GitLab. The default option lets them create GitGroups. We have specific workflows and approval process where GitGroups has to go through our team.

Is there an option to disable the ability for users to create Git Group by default?
Or do it on a level for all “regular users” but keep for “admin” users.

thanks in advance,

GitLab community edition (currently ver 12.10.6), internally hosted.

From the documentation:

For Omnibus installations, add the following to /etc/gitlab/gitlab.rb :

gitlab_rails['gitlab_default_can_create_group'] = false

For source installations, uncomment the following line in config/gitlab.yml :

# default_can_create_group: false  # default: true
2 Likes

Much thanks

Update: The global setting applies for new users. One shotting the existing user base is possible via the existing api.

Example

git_api_response="$(curl -H $HEADER1 \
                         -H "PRIVATE-TOKEN: $1" \
                         --request PUT \
                         -s "$URL/$git_user_id?can_create_group=false")"

Helper, can fetch username to get the user ID

git_user_id="$(curl -H $HEADER1 \
    -H "PRIVATE-TOKEN: $1" \
    --request GET \
    -s "$URL?username=$git_user_name" | jq -r 'sort_by(.username) | . | map("\(.id)") | .[]')"

For the list, scrubbed root and the ops team that still need them.