Jump to content

setting permissions for documents?


ianbauer

Recommended Posts

I am building a website for a group of researchers.  They want to be able to upload documents for viewing but only certain doctors may view any given document.  Is there a way I can assign permissions to the documents so that specific individuals may view them?  I am told that there may be 20 different permission levels.  Also, they are not able to create document categories but would be working off an excel spreadsheet that will tell which doctors may view each document.

Thank you in advance for any help.

Link to comment
https://forums.phpfreaks.com/topic/162034-setting-permissions-for-documents/
Share on other sites

it sounds like your creating a login system, if so then your need to control the access level via permissions you setup in the database, please note this is not the same as the filesystem permission, as all users will be using the same account name for accessing the files via PHP,

yes and no,,the initial page will have a login, there will be perhaps 100 doctors that can log into the site.  then there is another page that has a list of documents..(no set format for docs)  from this page the user will click on a document to read it.  this is where I need to curtail use as only certain doctors will be able to read certain documents.  this is where I get confused on how I would do this.

okay so you already have a login system in place.  So add a userLevel column to the database and assign a user level to each doctor.  Then have a table in your database (example called documents) that has a list of all the file names in one column (documentName), as well as a file level column (fileLevel)associated with it.  Then on the page that lists the documents, you would (assuming the table with the user login info is located is called userTable):

 

select documentName from documents where fileLevel <= userTable.userLevel

 

loop through and display the results via php.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.