summaryrefslogtreecommitdiff
path: root/app/finders/releases_finder.rb
blob: 59e84198fdeb971aedd39cd7cf8002d762d8f6f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 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