Forum: Ruby on Rails ACL Navigation Links

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5dd60445347fc3dec62474cc732fef0d?d=identicon&s=25 Kyle Mathews (Guest)
on 2005-12-22 08:52
(Received via mailing list)
I'm currently using the ACL (Access Control Lists) system in my app.
The access control is working great, but I'd like to use the
permissions/roles setup in the database to hide links to areas a user
may not have access for automatically. I'm guessing that you could
setup a helper function to use instead of link_to and have it check
the permissions, but I'm not sure where to start with this. Can
someone point me in the right direction to do this?

Thanks,
Kyle
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 James Adam (Guest)
on 2005-12-22 12:29
(Received via mailing list)
You might want to look at the 'link_if_authorized' method provided in
the UserEngine, and adapt that as necessary.

- james
C8a634a01a2c4508360874bff7fb1a7f?d=identicon&s=25 Kevin Olbrich (Guest)
on 2005-12-22 13:20
You could also create your own using the 'link_to_if' helper function
and another function that checks for authorization.
This topic is locked and can not be replied to.