Forum: Ruby on Rails Preventing read access to a model

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Evan (Guest)
on 2009-03-02 00:35
(Received via mailing list)
In a model are there any methods that are called before providing
access to the model?

I'm exploring ways to enforce privileges in my app. Wondering if I can
define some sort of "before" method in the model to prevent read
access to the model unless certain conditions are true.


Rick (Guest)
on 2009-03-02 05:55
(Received via mailing list)
Go to  read about ActiveRecord::Callbacks

See also restful_authentication gem and simple_access_control plugin -
use them both.
This topic is locked and can not be replied to.