debian-mirror-gitlab/app/finders/ci/freeze_periods_finder.rb
2023-03-04 22:38:38 +05:30

16 lines
356 B
Ruby

# frozen_string_literal: true
module Ci
class FreezePeriodsFinder
def initialize(project, current_user = nil)
@project = project
@current_user = current_user
end
def execute
return Ci::FreezePeriod.none unless Ability.allowed?(@current_user, :read_freeze_period, @project)
@project.freeze_periods
end
end
end