Method: CanCan::Ability#authorize!
- Defined in:
- lib/cancan/ability.rb
#authorize!(action, subject, *args) ⇒ Object
See ControllerAdditions#authorize! for documentation.
201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/cancan/ability.rb', line 201 def (action, subject, *args) = nil if args.last.kind_of?(Hash) && args.last.has_key?(:message) = args.pop[:message] end if cannot?(action, subject, *args) ||= (action, subject) raise AccessDenied.new(, action, subject) end subject end |