Solved

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

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
by zero exception 10 83
String array comparison 4 57
ejb entity bean example 2 57
Java import explained 4 49
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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…
Suggested Courses

738 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