stffn / declarative_authorization

An unmaintained authorization plugin for Rails. Please fork to support current versions of Rails
MIT License
1.24k stars 231 forks source link

Breaking up authorization_rules.rb by role #191

Open Flagship8787 opened 10 years ago

Flagship8787 commented 10 years ago

Is there a way to put different roles into their own files and then include those files in authorization_rules.rb? This would make it much easier to debug large permission sheets.

daniel-rikowski commented 10 years ago

I tried to do this, since my rules are piling up, too. Since it is possible to have multiple class to authorization I was hoping I could simply load other files from withing authorization_rules.rb, but it didn't work. :frowning:

It looks like the DSL functions are not available in loaded files. (Exception is: Illegal DSL syntax: undefined method `authorization' for main:Object) Looks like the eval context is lost.