Solved

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

Posted on 2006-10-27
3
168 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now