diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-24 00:09:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-24 00:09:13 +0300 |
commit | 145fb28542af4441ee8dc5752f9879ec1c1de15d (patch) | |
tree | 9cb574f4a75eb6d0486b2ef076310c9092373d21 /app/finders | |
parent | 35272ed523e03fd0f2a77e6951eb4017cdb224ff (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/clusters/agents_finder.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/finders/clusters/agents_finder.rb b/app/finders/clusters/agents_finder.rb index d0b1240157c..8bc78300a44 100644 --- a/app/finders/clusters/agents_finder.rb +++ b/app/finders/clusters/agents_finder.rb @@ -4,8 +4,8 @@ module Clusters class AgentsFinder include FinderMethods - def initialize(project, current_user, params: {}) - @project = project + def initialize(object, current_user, params: {}) + @object = object @current_user = current_user @params = params end @@ -13,7 +13,7 @@ module Clusters def execute return ::Clusters::Agent.none unless can_read_cluster_agents? - agents = project.cluster_agents + agents = object.cluster_agents agents = agents.with_name(params[:name]) if params[:name].present? agents.ordered_by_name @@ -21,10 +21,10 @@ module Clusters private - attr_reader :project, :current_user, :params + attr_reader :object, :current_user, :params def can_read_cluster_agents? - current_user.can?(:read_cluster, project) + current_user&.can?(:read_cluster, object) end end end |