My problem is, that i cannot figure out a way to filter out how to filter a table so that the only information that displays is information that has a common city to, the User City.
my models are Leads, LnkServ, Company, Users
currently, the way it works is
Leads: PK = ID, FK = location_id
LnkServ: PK = ref_zip_id/company_id, FK = ref_zip_id/company_id
Company: PK = id, FK = user_id
Users: PK = id
the way it is set up now is that, for a given company there is a USER, this user has a location in ZIP code format that is referenced by an ID in another table (keeping it out for sake of simplicity). ultimately, the tables should be related to each other as stated above. my goal is to limit access to Leads by Users, based on how they are connected in the LnkServ table. how do i go about doing this?