Class: Ddr::Auth::EffectiveRoles

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/ddr/auth/effective_roles.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(obj, agents) ⇒ Ddr::Auth::Roles::RoleSetQuery

Parameters:

  • obj (Object)

    an object that receives :roles and returns a RoleSet

  • agents (String, Array<String>)

    agent(s) to match roles

Returns:



9
10
11
# File 'lib/ddr/auth/effective_roles.rb', line 9

def self.call(obj, agents)
  new(obj).call(agents)
end

Instance Method Details

#call(agents) ⇒ Ddr::Auth::Roles::RoleSetQuery

Parameters:

  • agents (String, Array<String>)

    agent(s) to match roles

Returns:



15
16
17
18
19
# File 'lib/ddr/auth/effective_roles.rb', line 15

def call(agents)
  ResourceRoles.call(self)
    .merge(InheritedRoles.call(self))
    .agent(agents)
end