This topic is locked

Document Management System

4/13/2011 10:37:37 AM
PHPRunner General questions
I
indigo author

Hi,
We want to create a document management system for a client.
Now, Admin will have rights to upload documents / files and will provide access to users for each file/document.

Its a closed group with few files and few users.
Can someone help as to how to setup access control for files?

Sergey Kornilov admin 4/13/2011

I guess you can add a cross-reference table that holds links to both users and documents i.e. tblDocumentsUsers (ID, DocumentID, UserID). Admin will assign rights to certain files adding new records to this table. DocumentID and UserID can be lookup wizards.
Then you can add a BeforeSQLQuery event to Documents table:

$strWhereClause = whereAdd($strWhereClause, "DocumentID in (select DocumentID from tblDocumentsUsers where UserID = '".$_SESSION["UserID"]."')";


This way users are only able to see documents that admin assigns to them.