Sha256: b37fc2dc959d46e12bdf098b2ed9d0d90f3a61e2df54d4f90a45a73bd75e6ee5

Contents?: true

Size: 251 Bytes

Versions: 36

Compression:

Stored size: 251 Bytes

Contents

module Ddr::Auth
  class EffectiveRoles

    def self.call(obj, agents = nil)
      ( obj.roles | obj.inherited_roles ).tap do |roles|
        if agents
          roles.select! { |r| agents.include?(r.agent) }
        end
      end
    end

  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ddr-core-1.6.1 lib/ddr/auth/effective_roles.rb
ddr-core-1.6.0 lib/ddr/auth/effective_roles.rb
ddr-core-1.5.5 lib/ddr/auth/effective_roles.rb
ddr-core-1.5.4 lib/ddr/auth/effective_roles.rb
ddr-core-1.5.2 lib/ddr/auth/effective_roles.rb
ddr-core-1.5.3 lib/ddr/auth/effective_roles.rb
ddr-core-1.5.1 lib/ddr/auth/effective_roles.rb
ddr-core-1.4.4 lib/ddr/auth/effective_roles.rb
ddr-core-1.4.3 lib/ddr/auth/effective_roles.rb
ddr-core-1.4.2 lib/ddr/auth/effective_roles.rb
ddr-core-1.4.0 lib/ddr/auth/effective_roles.rb
ddr-core-1.3.0 lib/ddr/auth/effective_roles.rb
ddr-core-1.2.0 lib/ddr/auth/effective_roles.rb
ddr-core-1.2.0.rc3 lib/ddr/auth/effective_roles.rb
ddr-core-1.2.0.rc2 lib/ddr/auth/effective_roles.rb
ddr-core-1.2.0.rc1 lib/ddr/auth/effective_roles.rb