When I was implementing our home-grown authorization system, I have to know what controllers are available, for the given controller, what actions are available. This shouldn't difficult using reflection within Ruby. But after reading the source code of Merb, I found it is dead simple to get what you want:
- Application.subclasses_list
- YourController.callable_actions
Here is the code in my Role modle:
Apr 10, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment