Restricting a FIND based on the results of another

Robert,

This it really depends on what the relationships are between these tables. One way would be to use a has_many, or has_many :through relationship between users and people... Use :through if you want to add other information to your access table... like this:

class User < ActiveRecord::Base     has_many :access     has_many :people, :through => :access end

... Then you could get all the people like this:

user = User.find(some_id) @people = user.people

or like:

user = User.find(some_id) @people = user.people.find(:all, :conditions => blah)

Not sure if this is the exact syntax... find more here: http://wiki.rubyonrails.org/rails/pages/ThroughAssociations

It sounds like what you really want is RBAC (Role Based Authentication Control). Have a look at ActiveRBAC: http://active-rbac.rubyforge.org/

Good luck, Peter