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

Make maintainers the default setting for creating subgroups

parent a2cd8e0d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -58,6 +58,8 @@ class Group < Namespace
 
add_authentication_token_field :runners_token, encrypted: -> { Feature.enabled?(:groups_tokens_optional_encryption, default_enabled: true) ? :optional : :required }
 
before_create :default_subgroup_creation_level_to_maintainers
after_create :post_create_hook
after_destroy :post_destroy_hook
after_save :update_two_factor_requirement
Loading
Loading
@@ -416,10 +418,6 @@ 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
Loading
Loading
@@ -449,4 +447,8 @@ class Group < Namespace
 
errors.add(:visibility_level, "#{visibility} is not allowed since there are sub-groups with higher visibility.")
end
def default_subgroup_creation_level_to_maintainers
self.subgroup_creation_level = ::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS
end
end
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