Class: Clusters::AgentAuthorizationsFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/clusters/agent_authorizations_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ AgentAuthorizationsFinder

Returns a new instance of AgentAuthorizationsFinder.


5
6
7
# File 'app/finders/clusters/agent_authorizations_finder.rb', line 5

def initialize(project)
  @project = project
end

Instance Method Details

#executeObject


9
10
11
12
13
# File 'app/finders/clusters/agent_authorizations_finder.rb', line 9

def execute
  # closest, most-specific authorization for a given agent wins
  (project_authorizations + implicit_authorizations + group_authorizations)
    .uniq(&:agent_id)
end