Exception: Verifica::AuthorizationError
- Defined in:
- lib/verifica/errors.rb
Overview
Instance Attribute Summary collapse
- #result ⇒ Object readonly private
Instance Method Summary collapse
-
#acl ⇒ Acl
Access Control List returned by ACL provider registered for this #resource_type in Authorizer.
- #action ⇒ Symbol
-
#context ⇒ Hash
Any additional keyword arguments that have been passed to the authorization call.
-
#explain ⇒ String
Detailed, human-readable description of authorization result.
-
#initialize(result) ⇒ AuthorizationError
constructor
private
A new instance of AuthorizationError.
- #resource ⇒ Object
-
#resource_id ⇒ Object
Resource ID returned by
resource.resource_id
. -
#resource_type ⇒ Symbol
Resource type returned by resource#resource_type.
-
#subject ⇒ Object
Subject of the authorization (e.g. current user, external service).
-
#subject_id ⇒ Object
Subject ID returned by
subject.subject_id
. -
#subject_sids ⇒ Array<String>
Array of subject Security Identifiers returned by
subject.subject_sids
. -
#subject_type ⇒ Symbol?
Subject type returned by
subject.subject_type
.
Constructor Details
#initialize(result) ⇒ AuthorizationError
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of AuthorizationError.
24 25 26 27 |
# File 'lib/verifica/errors.rb', line 24 def initialize(result) @result = result super(result.) end |
Instance Attribute Details
#result ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'lib/verifica/errors.rb', line 21 def result @result end |
Instance Method Details
#acl ⇒ Acl
Returns Access Control List returned by ACL provider registered for this #resource_type in Verifica::Authorizer.
70 71 72 |
# File 'lib/verifica/errors.rb', line 70 def acl result.acl end |
#action ⇒ Symbol
65 66 67 |
# File 'lib/verifica/errors.rb', line 65 def action result.action end |
#context ⇒ Hash
Returns any additional keyword arguments that have been passed to the authorization call.
75 76 77 |
# File 'lib/verifica/errors.rb', line 75 def context result.context end |
#explain ⇒ String
Returns detailed, human-readable description of authorization result. Includes subject, resource, resource ACL, and explains the reason why authorization was successful or failed. Extremely useful for debugging.
80 81 82 |
# File 'lib/verifica/errors.rb', line 80 def explain result.explain end |
#resource ⇒ Object
50 51 52 |
# File 'lib/verifica/errors.rb', line 50 def resource result.resource end |
#resource_id ⇒ Object
Returns resource ID returned by resource.resource_id
.
60 61 62 |
# File 'lib/verifica/errors.rb', line 60 def resource_id result.resource_id end |
#resource_type ⇒ Symbol
Returns resource type returned by resource#resource_type.
55 56 57 |
# File 'lib/verifica/errors.rb', line 55 def resource_type result.resource_type end |
#subject ⇒ Object
Returns subject of the authorization (e.g. current user, external service).
30 31 32 |
# File 'lib/verifica/errors.rb', line 30 def subject result.subject end |
#subject_id ⇒ Object
Returns subject ID returned by subject.subject_id
.
40 41 42 |
# File 'lib/verifica/errors.rb', line 40 def subject_id result.subject_id end |
#subject_sids ⇒ Array<String>
Returns array of subject Security Identifiers returned by subject.subject_sids
.
45 46 47 |
# File 'lib/verifica/errors.rb', line 45 def subject_sids result.subject_sids end |
#subject_type ⇒ Symbol?
Returns subject type returned by subject.subject_type
.
35 36 37 |
# File 'lib/verifica/errors.rb', line 35 def subject_type result.subject_type end |