I have setup GitLab 7.12 in my firm. But users start creating groups (and groups and groups ...) and it will become a total mess very soon. Does anyone know how to restrict groups creation to administrators of the platform ?
The idea is to have people creating projects in their personal space, and reserving groups for official ones.
Transferring an existing project into a group You can transfer an existing project into a group you own from the project settings page. First scroll down to the 'Dangerous settings' and click 'Show them to me'. Now you can pick any of the groups you manage as the new namespace for the group.
Create a Group in GitLabGitLab's interface makes it simple for new users to create groups. Tap on the Menu button, navigate to the Groups tab, and click Create group . At this point, we can create a new group from scratch or use an existing GitLab instance.
Because one user cannot "own" another namespace (not even admins), the only option to set up a scenario where two users own the same namespace is with a group.
For an Omnibus install, the correct place is:
/etc/gitlab/gitlab.rb
gitlab_rails['gitlab_default_can_create_group'] = false
Then you'll need to execute sudo gitlab-ctl reconfigure
and sudo gitlab-ctl restart
to apply the changes.
If you want to disable group creation for new users, at the moment you will have to edit the gitlab.yml
, specifically the setting default_can_create_group
, and set it to false
.
See gitlab.yml#L63@712d1768.
For existing users, you can also use the following command on gitlab-rails console:
irb(main):001:0> User.update_all can_create_group:false
And for old users, use something like (in rails console):
irb(main):012:0> @users.each do |u|
irb(main):013:1* u.can_create_group= false
irb(main):014:1> u.save
irb(main):015:1> end
For old users, the GitLab Users API: User modification (a REST API) can also be used for this purpose (set the value of can_create_group
to false
) and can be easily used for bulk changes in a for loop:
curl --request PUT https://gitlab.example.com/api/v4/users/:id?can_create_group=false
Note: Please have a look at available authentication methods at GitLab API Authentication.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With