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.
C608d449f87ba87dd4a3f653afb304c1?d=identicon&s=25 Evan (Guest)
on 2009-03-01 23: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.


Af2ce6689213fdb78913a9662b18da6b?d=identicon&s=25 Rick (Guest)
on 2009-03-02 04: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.