Data view based on group

loudy

Member
Hello all,
Here is my case.
I'm planing to build a database that different users from different locations can access this. but each user in this specific location only will see and view/edit/add records that belong to this department. he can not view other department records.
For example:

Data base structure will be the same tables same view .... etc ...

I will create: locations for example:
we have 8 offices in different cities, so the location name will be the city name.

New York, will have 8 users, who will enter data for New York clients only
Washington, will have 3 users, who will enter data for Washington clients only
Buffalo, will have 4 users, who will enter data for Buffalo clients only
.... etc.

So the idea is each location will access to this database but the users from New York can not see the clients in the database from Washington ... etc. just for confidentially reason.

Only the superusers can access all locations data, sort and produce report.

Is that possible?
 
Assuming you are doing this with J! usergroups for your different locations, and you have 'user' element which records who creates the record ...

Create a pre-filter:

WHERE
Field: userid(raw)
Condition: IN
Value: SELECT ug.user_id FROM #__users_usergroup_map AS ug LEFT JOIN #__users AS u ON u.id = ug.user_id WHERE ug.user_id = '{$my->id}' AND ug.group_id IN (x,y,z)
Type: query

Replace x,y,z with the numeric group IDs of your J! groups for the locations.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top