summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Papa <fabtheman@gmail.com>2019-07-05 10:10:27 -0700
committerFabio Papa <fabtheman@gmail.com>2019-07-05 10:10:27 -0700
commit70cdea00b22b5ebb0d7f57993e592109f27b4588 (patch)
treebb0d0bb77c4c70fb20ce24ef5d40c7b85223c29b
parente9f9cc8937bc86b582424929fc8e961f003caf96 (diff)
parent98745a76dcbf7290c8299bdb3cfe8d0e36723fa8 (diff)
downloadgitlab-ce-70cdea00b22b5ebb0d7f57993e592109f27b4588.tar.gz
Merge branch 'maintainers-can-create-subgroup' of https://gitlab.com/fapapa/gitlab-ce into maintainers-can-create-subgroup
-rw-r--r--app/models/group.rb4
-rw-r--r--spec/controllers/admin/groups_controller_spec.rb6
-rw-r--r--spec/support/shared_contexts/policies/group_policy_shared_context.rb4
3 files changed, 8 insertions, 6 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index 9520db1bc0a..3f80c1373f1 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -416,6 +416,10 @@ class Group < Namespace
super || ::Gitlab::CurrentSettings.default_project_creation
end
+ def subgroup_creation_level
+ super || ::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS
+ end
+
private
def update_two_factor_requirement
diff --git a/spec/controllers/admin/groups_controller_spec.rb b/spec/controllers/admin/groups_controller_spec.rb
index 398f587bafe..1123563c1e3 100644
--- a/spec/controllers/admin/groups_controller_spec.rb
+++ b/spec/controllers/admin/groups_controller_spec.rb
@@ -70,13 +70,11 @@ describe Admin::GroupsController do
end
it 'updates the subgroup_creation_level successfully' do
- OWNER = ::Gitlab::Access::OWNER_SUBGROUP_ACCESS
-
expect do
post :update,
params: { id: group.to_param,
- group: { subgroup_creation_level: OWNER } }
- end.to change { group.reload.subgroup_creation_level }.to(OWNER)
+ group: { subgroup_creation_level: ::Gitlab::Access::OWNER_SUBGROUP_ACCESS } }
+ end.to change { group.reload.subgroup_creation_level }.to(::Gitlab::Access::OWNER_SUBGROUP_ACCESS)
end
end
end
diff --git a/spec/support/shared_contexts/policies/group_policy_shared_context.rb b/spec/support/shared_contexts/policies/group_policy_shared_context.rb
index 74389c4d82b..599c912ce00 100644
--- a/spec/support/shared_contexts/policies/group_policy_shared_context.rb
+++ b/spec/support/shared_contexts/policies/group_policy_shared_context.rb
@@ -20,8 +20,8 @@ RSpec.shared_context 'GroupPolicy context' do
let(:developer_permissions) { [:admin_milestone] }
let(:maintainer_permissions) do
%i[
- create_projects
- read_cluster create_cluster update_cluster admin_cluster add_cluster
+ create_projects read_cluster create_cluster update_cluster
+ admin_cluster add_cluster
]
end
let(:owner_permissions) do