small medium large xlarge

Generic-user-small
28 Dec 2007, 02:19
Cris Paltenghe (4 posts)

I am trying to implement a Role Based Access Control (RBAC) framework. I would like to have a drop down list of the controllers the application provides in a form that lists Rights (permissions). A “Right” is basically a Controller and an Action.

When one assigns Rights to a Role, I would like to have a complete list of all the possible Rights. Ideally, I want the application to tell me that without having to hardcode them.

I have tried ApplicationController.subclasses, but that apparently only returns the immediate controller that happens to be in context. Is there a way to get a collection returned of all the controllers for an application (the actual classes)? I intend to loop through them and then ask each subclass for the actions it provides. (aController.action_methods ??)

Suggestions?

You must be logged in to comment