Skip to content
Snippets Groups Projects
Commit c96b503b authored by Fabio Papa's avatar Fabio Papa
Browse files

Add policy to allow maintainers to create subgroups when enabled

parent 130261c5
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -38,6 +38,10 @@ class GroupPolicy < BasePolicy
@subject.project_creation_level == ::Gitlab::Access::DEVELOPER_MAINTAINER_PROJECT_ACCESS
end
 
condition(:maintainer_can_create_group) do
@subject.subgroup_creation_level == ::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS
end
rule { public_group }.policy do
enable :read_group
enable :read_list
Loading
Loading
@@ -105,6 +109,7 @@ class GroupPolicy < BasePolicy
end
 
rule { owner & nested_groups_supported }.enable :create_subgroup
rule { maintainer & maintainer_can_create_group & nested_groups_supported }.enable :create_subgroup
 
rule { public_group | logged_in_viewable }.enable :view_globally
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment