Closed mguymon closed 11 years ago
For my scenario, we have a authorizer generator that tweaks the authorizer at runtime for each class.
I'm having a hard time picturing your use case and would love to hear more about it if you care to explain.
For instance:
The Rails app extensively uses STI, so a Content model will be subclassed into Article, SlideShow, etc. Authorized actions to the model also depends on a workflow (Article is approved by an Editor, so it can now be Read by a User). The ContentAuthorizerGenerator
creates an Authorize class with configurations for the specific model being used. The authorizer is generated once for each model based on app's runtime config:
include Authority::Abilities
self.authorizer_class = ContentAuthorizerGenerator.create(Article, opts)
I see. Well, the pull request is merged! I'll try to release a new version soon; in the meantime you can point your Gemfile to the merge commit on Github if you want.
Add the ability to define the authorizer by class, such as
in addition to
This will allow runtime classes to be used as the Authorizer.
For my scenario, we have a authorizer generator that tweaks the authorizer at runtime for each class.