Method: WhurlEngine::Config.authorize_with
- Defined in:
- lib/whurl_engine/config.rb
.authorize_with(*args, &block) ⇒ Object
Setup authorization to be run as a before filter This is run inside the controller instance so you can setup any authorization you need to.
By default, there is no authorization.
To use an authorization adapter, pass the name of the adapter. For example, to use with CanCan, pass it like this.
See the wiki for more on authorization.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/whurl_engine/config.rb', line 35 def (*args, &block) extension = args.shift if(extension) = Proc.new { = WhurlEngine::AUTHORIZATION_ADAPTERS[extension].new(*([self] + args).compact) } else = block if block end || DEFAULT_AUTHORIZE end |