Sha256: e8752c26d5f974ed3dc8964e8c0afbab5764dcbb247112fcfa45d3594985a2ee

Contents?: true

Size: 592 Bytes

Versions: 82

Compression:

Stored size: 592 Bytes

Contents

require "delegate"

module Ddr::Auth
  class EffectiveRoles < SimpleDelegator

    # @param obj [Object] an object that receives :roles and returns a RoleSet
    # @param agents [String, Array<String>] agent(s) to match roles
    # @return [Ddr::Auth::Roles::RoleSetQuery]
    def self.call(obj, agents)
      new(obj).call(agents)
    end

    # @param agents [String, Array<String>] agent(s) to match roles
    # @return [Ddr::Auth::Roles::RoleSetQuery]
    def call(agents)
      ResourceRoles.call(self)
        .merge(InheritedRoles.call(self))
        .agent(agents)
    end

  end
end

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
ddr-models-2.11.0 lib/ddr/auth/effective_roles.rb
ddr-models-2.10.2 lib/ddr/auth/effective_roles.rb
ddr-models-2.10.1 lib/ddr/auth/effective_roles.rb
ddr-models-2.10.0 lib/ddr/auth/effective_roles.rb
ddr-models-2.10.0.rc2 lib/ddr/auth/effective_roles.rb
ddr-models-2.10.0.rc1 lib/ddr/auth/effective_roles.rb
ddr-models-2.9.2 lib/ddr/auth/effective_roles.rb
ddr-models-2.9.1 lib/ddr/auth/effective_roles.rb
ddr-models-2.9.0 lib/ddr/auth/effective_roles.rb
ddr-models-2.9.0.rc1 lib/ddr/auth/effective_roles.rb
ddr-models-2.8.0 lib/ddr/auth/effective_roles.rb
ddr-models-2.8.0.rc1 lib/ddr/auth/effective_roles.rb
ddr-models-2.7.6 lib/ddr/auth/effective_roles.rb
ddr-models-2.7.5 lib/ddr/auth/effective_roles.rb
ddr-models-2.7.4 lib/ddr/auth/effective_roles.rb
ddr-models-2.7.3 lib/ddr/auth/effective_roles.rb
ddr-models-2.7.2 lib/ddr/auth/effective_roles.rb
ddr-models-2.7.1 lib/ddr/auth/effective_roles.rb
ddr-models-2.7.0 lib/ddr/auth/effective_roles.rb
ddr-models-2.7.0.rc1 lib/ddr/auth/effective_roles.rb