Closed christhekeele closed 11 years ago
Actually it looks like it is made to run without rails, but the gemspec doesn't give you the option.
@christhekeele - I'd love to have Authority usable with other frameworks, but I haven't needed the feature yet myself, so I haven't looked into it.
Is this something you want to take a crack at?
I'm doing so now, actually, trying to layer it on top of Padrino. I'll let you know how it goes!
The core Authority methods do work fine without Rails. The controller helpers, on the other hand, are obviously pretty specific to Rails.
I couldn't really find way to make the controller helpers cleanly decoupled from the framework. It'll either involve a lot of duplication or polluting your pretty clean logic with ugly variable names to achieve the decoupling. I figured the latter was better than the former.
My branch has two commits on it: the first decoupling the strict requirements on Rails for those who might just want the Model and Authorizer functionality; the second playing around with controller decoupling and auto-detecting. Take a look and tell me what you think.
Looking through the source, Authority isn't tied too tightly to Rails. ActiveSupport's the core Rails library being used.
While the Railtie and generators are nice, you could use a configuration or auto-detection mechanism to load those on demand/need.
ORM agnosticism is nice, but framework-agnosticism? That's great!
Plus an abstracted framework integration layer would make it easier for people (cough) to contribute new integrations.