summaryrefslogtreecommitdiff
path: root/app/models/group.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/group.rb')
-rw-r--r--app/models/group.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index b93fce6100d..f625b8c250c 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -22,6 +22,7 @@ class Group < Namespace
has_many :shared_projects, through: :project_group_links, source: :project
has_many :notification_settings, dependent: :destroy, as: :source # rubocop:disable Cop/ActiveRecordDependent
has_many :labels, class_name: 'GroupLabel'
+ has_many :variables, class_name: 'Ci::GroupVariable'
validate :avatar_type, if: ->(user) { user.avatar.present? && user.avatar_changed? }
validate :visibility_level_allowed_by_projects
@@ -248,6 +249,13 @@ class Group < Namespace
}
end
+ def secret_variables_for(ref, project)
+ variables = []
+ variables += parent.secret_variables_for(ref, project) if has_parent?
+ variables += project.protected_for?(ref) ? self.variables : self.variables.unprotected
+ variables
+ end
+
protected
def update_two_factor_requirement