Commit b5f19500a09c3244a35b91dcccd45dacbfd93010

Authored by Jacob Vosmaer
2 parents aea453e8 18679b2a

Merge branch 'restricted_visibility_levels' into 'master'

Restricted visibility levels

This merge-request enables the __restricted_visibility_levels__ option in the gitlab config file (`/etc/gitlab/gitlab.rb`).

By default, it enables all the options: public, internal and private.

To disable __public__ and enable __internal__ and __private__, add the following line to your `/etc/gitlab/gitlab.rb`:
gitlab_rails['gitlab_restricted_visibility_levels'] = [ "public" ]

To disable __public__ and __internal__, and enable __private__, add one of the following lines to your `/etc/gitlab/gitlab.rb` (both are equivalent):
gitlab_rails['gitlab_restricted_visibility_levels'] = [ "public", "internal"]
gitlab_rails['gitlab_restricted_visibility_levels'] = [ "public", "internal", "private" ]
CHANGELOG
... ... @@ -3,6 +3,8 @@
3 3 The latest version of this file can be found at the master branch of the
4 4 omnibus-gitlab repository.
5 5  
  6 +- Support changing the 'restricted_visibility_levels' option (Javier Palomo)
  7 +
6 8 7.1.0
7 9 - Build: explicitly use .forward for sending notifications
8 10 - Fix MySQL build for Ubuntu 14.04
... ...
files/gitlab-cookbooks/gitlab/attributes/default.rb
... ... @@ -60,6 +60,7 @@ default['gitlab']['gitlab-rails']['gitlab_username_changing_enabled'] = nil
60 60 default['gitlab']['gitlab-rails']['gitlab_default_theme'] = nil
61 61 default['gitlab']['gitlab-rails']['gitlab_signup_enabled'] = nil
62 62 default['gitlab']['gitlab-rails']['gitlab_signin_enabled'] = nil
  63 +default['gitlab']['gitlab-rails']['gitlab_restricted_visibility_levels'] = nil
63 64 default['gitlab']['gitlab-rails']['gitlab_default_projects_features_issues'] = true
64 65 default['gitlab']['gitlab-rails']['gitlab_default_projects_features_merge_requests'] = true
65 66 default['gitlab']['gitlab-rails']['gitlab_default_projects_features_wiki'] = true
... ...
files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb
... ... @@ -55,7 +55,7 @@ production: &base
55 55  
56 56 # Restrict setting visibility levels for non-admin users.
57 57 # The default is to allow all levels.
58   - #restricted_visibility_levels: [ "public" ]
  58 + restricted_visibility_levels: <%= @gitlab_restricted_visibility_levels unless @gitlab_restricted_visibility_levels.nil? %>
59 59  
60 60 ## Automatic issue closing
61 61 # If a commit message matches this regular expression, all issues referenced from the matched text will be closed.
... ...