Sha256: e90b294ea887cd21c1ffdb8ecfbb7156fb5613e7497c6857a641327c46e1244a

Contents?: true

Size: 472 Bytes

Versions: 82

Compression:

Stored size: 472 Bytes

Contents

require "delegate"

module Ddr::Auth
  class InheritedRoles < SimpleDelegator

    # @param obj [Object] an object that receives :roles and returns a RoleSet
    # @return [Ddr::Auth::Roles::RoleSetQuery]
    def self.call(obj)
      new(obj).call
    end

    # @return [Ddr::Auth::Roles::DetachedRoleSet]
    def call
      if has_admin_policy?
        admin_policy.roles.in_policy_scope.detach
      else
        Roles::DetachedRoleSet.new
      end
    end

  end
end

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
ddr-models-3.0.0.alpha.2 lib/ddr/auth/inherited_roles.rb
ddr-models-3.0.0.alpha.1 lib/ddr/auth/inherited_roles.rb
ddr-models-2.2.0 lib/ddr/auth/inherited_roles.rb
ddr-models-2.1.3 lib/ddr/auth/inherited_roles.rb
ddr-models-2.1.2 lib/ddr/auth/inherited_roles.rb
ddr-models-2.1.1 lib/ddr/auth/inherited_roles.rb
ddr-models-2.1.0 lib/ddr/auth/inherited_roles.rb
ddr-models-2.1.0.rc2 lib/ddr/auth/inherited_roles.rb
ddr-models-2.1.0.rc1 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.1 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.0 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.0.rc6 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.0.rc5 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.0.rc4 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.0.rc3 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.0.rc2 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.0.rc1 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.0.pre.5 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.0.pre.4 lib/ddr/auth/inherited_roles.rb
ddr-models-2.0.0.pre.3 lib/ddr/auth/inherited_roles.rb