Forum: Ruby on Rails Preventing read access to a model

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.
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.

Thanks.

Evan
Rick (Guest)
on 2009-03-02 05:55
(Received via mailing list)
Go to http://api.rubyonrails.org/  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.