debian-mirror-gitlab/app/finders/releases_finder.rb

15 lines
303 B
Ruby
Raw Normal View History

2019-02-13 22:33:31 +05:30
# frozen_string_literal: true
class ReleasesFinder
def initialize(project, current_user = nil)
@project = project
@current_user = current_user
end
def execute
return Release.none unless Ability.allowed?(@current_user, :read_release, @project)
@project.releases.sorted
end
end