stffn/declarative_authorization — Issue #116: Disable authorization rules in browser
Author: Odaeus
Created: 2011-10-21 00:19:34+00:00
State: open

Hi,

I just installed the Resque gem and when starting up a worker in development with `QUEUE=* rake environment resque:work` I get an exception due to it calling Rails' eager preloading which loads Rails engines:

```
Authorization::DevelopmentSupport::Analyzer requires ruby_parser gem
/home/andrew/.rvm/gems/ruby-1.9.3-rc1/gems/declarative_authorization-0.5.3/lib/declarative_authorization/development_support/analyzer.rb:9:in `rescue in '
```

The relevant engine files have a condition check for `Authorization::activate_authorization_rules_browser?` to stop them loading when needed but this only checks if the current Rails environment is development.

Is there a way to disable this permanently? Adding the ruby_parser gem slows down my application boot by over a second and I don't use the rules browser.

I guess a reasonable solution would be to override the `activate_authorization_rules_browser?` value in an initializer with a class variable. I would be able to submit a patch for that.

Thanks!
Andrew