Commit 16cc1300 authored by Fabio Papa's avatar Fabio Papa

Add examples specing the setting to choose who can create subgroups

This setting is at the group level only. The default is specified to
be maintainers and owners.

**Specs only**, all failing.
parent d287a9b7
...@@ -5,6 +5,7 @@ FactoryBot.define do ...@@ -5,6 +5,7 @@ FactoryBot.define do
type 'Group' type 'Group'
owner nil owner nil
project_creation_level ::Gitlab::Access::MAINTAINER_PROJECT_ACCESS project_creation_level ::Gitlab::Access::MAINTAINER_PROJECT_ACCESS
subgroup_creation_level ::Gitlab::Access::OWNER_SUBGROUP_ACCESS
after(:create) do |group| after(:create) do |group|
if group.owner if group.owner
......
...@@ -19,15 +19,10 @@ RSpec.shared_context 'GroupPolicy context' do ...@@ -19,15 +19,10 @@ RSpec.shared_context 'GroupPolicy context' do
let(:reporter_permissions) { [:admin_label] } let(:reporter_permissions) { [:admin_label] }
let(:developer_permissions) { [:admin_milestone] } let(:developer_permissions) { [:admin_milestone] }
let(:maintainer_permissions) do let(:maintainer_permissions) do
[ %i[
:create_projects, create_projects
:read_cluster, read_cluster create_cluster update_cluster admin_cluster add_cluster
:create_cluster, ]
:update_cluster,
:admin_cluster,
:add_cluster,
(Gitlab::Database.postgresql? ? :create_subgroup : nil)
].compact
end end
let(:owner_permissions) do let(:owner_permissions) do
[ [
...@@ -35,7 +30,8 @@ RSpec.shared_context 'GroupPolicy context' do ...@@ -35,7 +30,8 @@ RSpec.shared_context 'GroupPolicy context' do
:admin_namespace, :admin_namespace,
:admin_group_member, :admin_group_member,
:change_visibility_level, :change_visibility_level,
:set_note_created_at :set_note_created_at,
(Gitlab::Database.postgresql? ? :create_subgroup : nil)
].compact ].compact
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment