Exception: ActionPolicy::Unauthorized
- Defined in:
- lib/action_policy/authorizer.rb
Overview
Raised when ‘authorize!` check fails
Instance Attribute Summary collapse
-
#policy ⇒ Object
readonly
Returns the value of attribute policy.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Instance Method Summary collapse
-
#initialize(policy, rule) ⇒ Unauthorized
constructor
A new instance of Unauthorized.
Constructor Details
#initialize(policy, rule) ⇒ Unauthorized
Returns a new instance of Unauthorized.
8 9 10 11 12 13 14 |
# File 'lib/action_policy/authorizer.rb', line 8 def initialize(policy, rule) @policy = policy.class @rule = rule @result = policy.result super("Not Authorized") end |
Instance Attribute Details
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
6 7 8 |
# File 'lib/action_policy/authorizer.rb', line 6 def policy @policy end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
6 7 8 |
# File 'lib/action_policy/authorizer.rb', line 6 def result @result end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
6 7 8 |
# File 'lib/action_policy/authorizer.rb', line 6 def rule @rule end |