Database Design Question
February 4th, 2008 By biswal.srikant
A table contains information about a company. There is different information about different departments. A user from a department only accesses his department information. But an administrator can access the information of any department.
Example:
UserTable (userId, userName, userType, departmentId)
DepartmentTable (departmentId, departmentName, folderId)
FolderTable (folderId, folderName)
userType: ordinaryUser, Administrator
My question is how ordinaryUser can access same department information only. But administrator can access all department information? What are the constraints to design the above database?
Thanks.

February 5th, 2008 at 1:22 am
If you have an Enterprise Edition licence Oracle 8.1.7.4 or higher then the one and only correct answer is Virtual Private Database AKA row level security.
Your other alternatives are views and/or programmatic interfaces built out of PL/SQL.
Cheers, APC