Method: Ckeditor.authorize_with
- Defined in:
- lib/ckeditor.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.
171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/ckeditor.rb', line 171 def self.(*args, &block) extension = args.shift if extension @authorize = Proc.new { @authorization_adapter = Ckeditor::AUTHORIZATION_ADAPTERS[extension].new(*([self] + args).compact) } else @authorize = block if block end @authorize || DEFAULT_AUTHORIZE end |