Class: Kindergarten::AccessDenied
- Inherits:
-
CanCan::AccessDenied
- Object
- CanCan::AccessDenied
- Kindergarten::AccessDenied
- Defined in:
- lib/kindergarten/exceptions.rb
Overview
Signals unallowed access
Instance Method Summary collapse
-
#initialize(action, target, opts) ⇒ AccessDenied
constructor
A new instance of AccessDenied.
Constructor Details
#initialize(action, target, opts) ⇒ AccessDenied
Returns a new instance of AccessDenied.
4 5 6 7 8 9 10 11 12 |
# File 'lib/kindergarten/exceptions.rb', line 4 def initialize(action, target, opts) = opts.delete(:message) if .blank? name = target.is_a?(Class) ? target.name : target.class.name = "You are not allowed to #{action} that #{name.downcase}" end super(, action, target) end |