Module: AuthorizeWhen::ClassMethods
- Defined in:
- lib/authorize_when.rb
Instance Method Summary collapse
Instance Method Details
#authorize(options = {}, &block) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/authorize_when.rb', line 28 def ( = {}, &block) = {} [:only] = [:when] [:except] = [:when_not] self.send(:before_filter, ) do |controller| if !controller.instance_eval(&block) raise AuthorizeWhen::ForbiddenException end end end |