Exception: Shamu::Security::AccessDeniedError
- Defined in:
- lib/shamu/security/error.rb
Overview
The requested action was not permitted on the resource.
Attributes collapse
-
#action ⇒ Symbol
readonly
The requested action that was denied.
-
#additional_context ⇒ Object
readonly
Additional principal provided to the policy authorization method.
-
#principal ⇒ Principal
readonly
The security Principal in use at the time of the policy violation.
-
#resource ⇒ Object
readonly
The resource the #action was to be performed on.
Instance Method Summary collapse
-
#initialize(message = :access_denied, action: nil, resource: nil, principal: nil, additional_context: nil) ⇒ AccessDeniedError
constructor
A new instance of AccessDeniedError.
Constructor Details
#initialize(message = :access_denied, action: nil, resource: nil, principal: nil, additional_context: nil) ⇒ AccessDeniedError
Returns a new instance of AccessDeniedError.
40 41 42 43 44 45 46 47 |
# File 'lib/shamu/security/error.rb', line 40 def initialize( = :access_denied, action: nil, resource: nil, principal: nil, additional_context: nil ) @action = action @resource = resource @principal = principal @additional_context = additional_context super translate( :access_denied, action: action, resource: resource ) end |
Instance Attribute Details
#action ⇒ Symbol (readonly)
Returns the requested action that was denied.
24 25 26 |
# File 'lib/shamu/security/error.rb', line 24 def action @action end |
#additional_context ⇒ Object (readonly)
Returns additional principal provided to the policy authorization method.
35 36 37 |
# File 'lib/shamu/security/error.rb', line 35 def additional_context @additional_context end |
#principal ⇒ Principal (readonly)
Returns the security Principal in use at the time of the policy violation.
31 32 33 |
# File 'lib/shamu/security/error.rb', line 31 def principal @principal end |
#resource ⇒ Object (readonly)
Returns the resource the #action was to be performed on.
27 28 29 |
# File 'lib/shamu/security/error.rb', line 27 def resource @resource end |