Exception: Fosm::AccessDenied
- Defined in:
- lib/fosm/errors.rb
Overview
Raised when an actor attempts an action they don’t have a role for. Applies to both lifecycle events (fire!) and CRUD operations (fosm_authorize!).
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#actor ⇒ Object
readonly
Returns the value of attribute actor.
Instance Method Summary collapse
-
#initialize(action, actor = nil) ⇒ AccessDenied
constructor
A new instance of AccessDenied.
Constructor Details
#initialize(action, actor = nil) ⇒ AccessDenied
Returns a new instance of AccessDenied.
45 46 47 48 49 50 |
# File 'lib/fosm/errors.rb', line 45 def initialize(action, actor = nil) @action = action @actor = actor label = actor_label(actor) super("Access denied: '#{label}' does not have a role that permits '#{action}'") end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
43 44 45 |
# File 'lib/fosm/errors.rb', line 43 def action @action end |
#actor ⇒ Object (readonly)
Returns the value of attribute actor.
43 44 45 |
# File 'lib/fosm/errors.rb', line 43 def actor @actor end |