diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2017-08-29 16:49:43 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2017-08-29 16:49:43 +0200 |
commit | 67c042e4a5603a39494c3c7e407161348d7e85f3 (patch) | |
tree | 514ae3b378b6d2502c14bc85f3e33d61a4f299b1 | |
parent | 2a8dec2c27726cd0af995de97e596eab78e6efbf (diff) | |
download | gitlab-ce-67c042e4a5603a39494c3c7e407161348d7e85f3.tar.gz |
Respect the default visibility level when creating a group
-rw-r--r-- | lib/api/groups.rb | 4 | ||||
-rw-r--r-- | spec/requests/api/groups_spec.rb | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index e56427304a6..15266e9d4e5 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -7,7 +7,9 @@ module API helpers do params :optional_params_ce do optional :description, type: String, desc: 'The description of the group' - optional :visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: 'The visibility of the group' + optional :visibility, type: String, values: Gitlab::VisibilityLevel.string_values, + default: Gitlab::VisibilityLevel.string_level(Gitlab::CurrentSettings.current_application_settings.default_group_visibility), + desc: 'The visibility of the group' optional :lfs_enabled, type: Boolean, desc: 'Enable/disable LFS for the projects in this group' optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access' optional :share_with_group_lock, type: Boolean, desc: 'Prevent sharing a project with another group within this group' diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb index a7557c7fb22..c6bc0c25e99 100644 --- a/spec/requests/api/groups_spec.rb +++ b/spec/requests/api/groups_spec.rb @@ -444,6 +444,7 @@ describe API::Groups do expect(json_response["name"]).to eq(group[:name]) expect(json_response["path"]).to eq(group[:path]) expect(json_response["request_access_enabled"]).to eq(group[:request_access_enabled]) + expect(json_response["visibility"]).to eq(Gitlab::VisibilityLevel.string_level(Gitlab::CurrentSettings.current_application_settings.default_group_visibility)) end it "creates a nested group", :nested_groups do |