diff options
author | Fabio Papa <fabtheman@gmail.com> | 2019-06-28 16:12:54 -0700 |
---|---|---|
committer | Fabio Papa <fabtheman@gmail.com> | 2019-07-19 12:06:57 -0700 |
commit | bcc970f6f5ec3b48db2417c23bc81d4240a0c47d (patch) | |
tree | 335a00e248b46aac1d0cb67400f28a387c2735f2 /app | |
parent | a2cd8e0dab5c5efb3f1c6a6968337b371e194a24 (diff) | |
download | gitlab-ce-bcc970f6f5ec3b48db2417c23bc81d4240a0c47d.tar.gz |
Make maintainers the default setting for creating subgroups
Diffstat (limited to 'app')
-rw-r--r-- | app/models/group.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index 3f80c1373f1..8f39c3a658f 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -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 @@ -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 @@ -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 |