Class: Shamu::Security::DelegatePrincipal

Inherits:
Principal
  • Object
show all
Defined in:
lib/shamu/security/delegate_principal.rb

Overview

...

Instance Attribute Summary

Attributes inherited from Principal

#elevated, #parent_principal, #remote_ip, #scopes, #user_id

Instance Method Summary collapse

Methods inherited from Principal

#anonymous?, #impersonated?, #initialize, #scoped?, #user_id_chain

Constructor Details

This class inherits a constructor from Shamu::Security::Principal

Instance Method Details

#impersonate(user_id) ⇒ Principal

Create a new impersonation Principal, cloning relevant principal to the new instance.

Parameters:

  • user_id (Object)

    of the user to impersonate.

Returns:



8
9
10
# File 'lib/shamu/security/delegate_principal.rb', line 8

def impersonate( user_id )
  fail NoPolicyImpersonationError
end

#service_delegate?Boolean

Returns true if the principal was offered by one service to another and requesting that the downstream service delegate security checks to the calling service.

Returns:

  • (Boolean)

    true if the principal was offered by one service to another and requesting that the downstream service delegate security checks to the calling service.



13
14
15
# File 'lib/shamu/security/delegate_principal.rb', line 13

def service_delegate?
  true
end