blob: 26e9182f4e1a0534c6ddaa74320138dd815b0431 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# frozen_string_literal: true
module Packages
module Conan
class PackageFinder
attr_reader :current_user, :query
def initialize(current_user, params)
@current_user = current_user
@query = params[:query]
end
def execute
packages_for_current_user.with_name_like(query).order_name_asc if query
end
private
def packages
Packages::Package.conan
end
def packages_for_current_user
packages.for_projects(projects_visible_to_current_user)
end
def projects_visible_to_current_user
::Project.public_or_visible_to_user(current_user)
end
end
end
end
|