summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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