ssteinke
for what it's worth
- Local time
- Today, 07:57
- Joined
- Aug 2, 2003
- Messages
- 195
I am trying to restrict the user from only seeing the records that apply to that user. Given the following tables:
tblSecurityControls
SecurityControlID pk
SecurityControl
tblDepartments
DepartmentID pk
Department
tblUsers
UserID pk
UserName
tblRecords
RecordID pk
SecurityControlID fk
DepartmentID fk
tblUserRecords
UserID fk
RecordID fk
You will notice that tblRecords has a one-many relationship with tblUserRecords. This is done because of the following rules: If the SecurityControlID=1 in tblRecords, then the record is PRIVATE and it should only be available to the users identified in tblUserRecords. If the SecurityControlID=2 then the record is accessible only to the Department which created the record. If the SecurityControlID=3, then the record is globally available to ALL Departments. The current user's UserID & DepartmentID are held in global variables during the session, i.e. gUserID & gDepartmentID.
How do I show only the records in tblRecords that are available to the current user given the previously identified rules? Would I need to perform multiple queries?
Thanks in advance,
~Scott
tblSecurityControls
SecurityControlID pk
SecurityControl
tblDepartments
DepartmentID pk
Department
tblUsers
UserID pk
UserName
tblRecords
RecordID pk
SecurityControlID fk
DepartmentID fk
tblUserRecords
UserID fk
RecordID fk
You will notice that tblRecords has a one-many relationship with tblUserRecords. This is done because of the following rules: If the SecurityControlID=1 in tblRecords, then the record is PRIVATE and it should only be available to the users identified in tblUserRecords. If the SecurityControlID=2 then the record is accessible only to the Department which created the record. If the SecurityControlID=3, then the record is globally available to ALL Departments. The current user's UserID & DepartmentID are held in global variables during the session, i.e. gUserID & gDepartmentID.
How do I show only the records in tblRecords that are available to the current user given the previously identified rules? Would I need to perform multiple queries?
Thanks in advance,
~Scott