- Prerequisites
- Prevent users from creating top-level groups
- Prevent users from changing their usernames
- Prevent Guest users from promoting to a higher role
Modify global user settings
You can modify settings for every user in your GitLab instance.
Prerequisites
- You must be an administrator of a self-managed GitLab instance.
Prevent users from creating top-level groups
By default, new users can create top-level groups. How you prevent users from creating top-level groups differs between new and existing users.
For new users
To prevent new users from creating top-level groups:
- In GitLab 15.5 and later, use either:
- The GitLab UI.
- The Application settings API.
- In GitLab 15.4 and earlier, modify a configuration file:
-
Edit
/etc/gitlab/gitlab.rb
and add the following line:gitlab_rails['gitlab_default_can_create_group'] = false
-
Edit
config/gitlab.yml
and uncomment the following line:# default_can_create_group: false # default: true
For existing users
To prevent existing users from creating top-level groups, use either:
Prevent users from changing their usernames
By default, users can change their usernames. To prevent users from changing their usernames:
-
Edit
/etc/gitlab/gitlab.rb
and add the following line:gitlab_rails['gitlab_username_changing_enabled'] = false
-
Edit
config/gitlab.yml
and uncomment the following line:# username_changing_enabled: false # default: true - User can change their username/namespace
Prevent Guest users from promoting to a higher role
On GitLab Ultimate, Guest users do not count toward paid seats. However, when a Guest user creates projects and namespaces, they are automatically promoted to a higher role than Guest and occupy a paid seat.
To prevent Guest users from being promoted to a higher role and occupying a paid seat, set the user as external.
External users cannot create personal projects or namespaces. If a user with the Guest role is promoted into a higher role by another user, the external user setting must be removed before they can create personal projects or namespaces. For a complete list of restrictions for external users, see External users.