Solved

how to distinguish private and public files(logical design question)

Posted on 2006-10-27
3
176 Views
Last Modified: 2010-03-31
Hi guys

I am creating a content management software where  admins are able to attach documents which the user would be able to see ont the website.
There are 2 types of users public and members. The admin can specify if the want everybody to see the doument or just the user. Now the problem is that
I store all the docments in one directory /attachement/documents whether private or public. The website takes care of what to show if they are logged in and what not to show.
but if they get the url of the docment such as http://xxx.com/attachemnets/docments/privatedocument.doc they would be able to open it even if they are not logged in.

Now what i need is a way to distinguish private and public documents. Would anyone have any good idea regarding this

--Thanks

0
Comment
Question by:huzefaq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
Jorge Fraser earned 200 total points
ID: 17819975
The easiest way to manage this is to store the documents in a database, that way you can mark the document at will. If this is not possible or do not want to do this, you could move the documents out of the server context and write a servlet that reads the documents and serves them to the user based on who the requestor is and what access they have.

Hope this helps.
0
 
LVL 14

Assisted Solution

by:hoomanv
hoomanv earned 300 total points
ID: 17820364
> and write a servlet that reads the documents and serves them

However you still need a way to distinguish between public and private files
Only store documents' names in database plus a flag indicating the access privilege
And access them like this
http://xyz.com/ContentManager?document=something
0
 

Author Comment

by:huzefaq
ID: 17861266
Thnak you guys for your help

But what I ended up doing was to make two different directory for public and private and made the access tot thw directory restricted in the filter.

0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question