debian-mirror-gitlab/app/finders/freeze_periods_finder.rb
2020-05-25 16:23:42 +05:30

14 lines
322 B
Ruby

# frozen_string_literal: true
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