Exception: Dry::Ability::AccessDenied
- Defined in:
- lib/dry/ability/exceptions.rb
Constant Summary collapse
- DEFAULT_MESSAGE_TEMPLATE =
"The requester is not authorized to %s %p."
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(message = nil, action, subject) ⇒ AccessDenied
constructor
A new instance of AccessDenied.
Constructor Details
#initialize(message = nil, action, subject) ⇒ AccessDenied
Returns a new instance of AccessDenied.
29 30 31 32 33 |
# File 'lib/dry/ability/exceptions.rb', line 29 def initialize( = nil, action, subject) @action, @subject = action, subject ||= format(DEFAULT_MESSAGE_TEMPLATE, action, subject.class) super() end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
27 28 29 |
# File 'lib/dry/ability/exceptions.rb', line 27 def action @action end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
27 28 29 |
# File 'lib/dry/ability/exceptions.rb', line 27 def subject @subject end |