gitlab-org--gitlab-foss/app/finders/freeze_periods_finder.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
322 B
Ruby
Raw Normal View History

# 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