The problem: Application sidebar needs to be able to determine which
links to display, based on which links a user can actually access. It
is important that the interface be DRY, as this is a security matter.
The proposed solution: For each controller, define an authorized?
method, and a before filter to redirect users if it fails. For each
link in the sidebar view, instantiate an appropriate controller
object, complete with params, and call authorized? on it, displaying
the link only if the response is true.
The HELP: I really don’t see how to properly instantiate this
controller. I really, REALLY don’t see how to do this in a rack
framework. In fact, it looks to me that what I want is to tear apart
the rack/rails boundary.
–
You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.