I may be off, but I would say that you would need to add your documents
table into this equation.
In your Documents table, do you have a field called "View_Type" or
something like that? Meaning, when the users upload a file they specify
the view type and it is stored in the db.
 
You could set a session variable whe the user logs in to specify which
documents they are allowed to view. I'm calling it View_permission. Then
they would be able to see the documents for their team and also the
documents that are open to all.
 
If so, you could do:
 
<CFQUERY name="docs" datasource="intranetv8">
SELECT docid, doctitle, docsummary, docpath, docView_type
FROM itdocs
WHERE category2='#URL.category2#'
AND
docview_Type='#session.View_permission#'
OR
docview_Type = 'all'
</CFQUERY>
 
 
 
Candace K. Cottrell, Web Developer 
The Children's Medical Center 
One Children's Plaza 
Dayton, OH 45404 
937-641-4293 
http://www.childrensdayton.org
 
 
[EMAIL PROTECTED]

>>> [EMAIL PROTECTED] 12/3/2002 7:02:31 AM >>>
I have been informed that user roles and groups for users is the best
approach but how does this exactly work from a Coldfusion persepective,
and
is this the best way to achieve my brief, or is the way I am planning
on
going the best approach?

This is my brief, I am creating an Intranet application that features
a
publishing area allowing users to add/delete/modify their own content
on the
site.  Using html forms, CFFile and Oracle to hold word and pdf docs. 
And
having a select form field where the user selects who should see the
file
teama, teamb or everybody

However some users of the Intranet are from teama and should only be
allowed
to view documents related to teama.  teamb have documents that only
their
team should see.  Finally there will be some documents that users
upload
that are available to everybody.

To access the Intranet the users have to log in, where their username
and
password is authenticated against the user table.  The user table has
fields..

id
username
password
fname
lname
division

If correct they enter the intranet. The click on the documents link
where
the following query would be run, I was thinking along the lines of
adding a
where clause perhaps ?  using the info where the user selected when
they
added the content - i.e. should it be see by teama, teamb or
everybody?

Is this the best way to achieve this ????

<CFQUERY name="docs" datasource="intranetv8">
SELECT docid, doctitle, docsummary, docpath, views
FROM itdocs
WHERE category2='#URL.category2#'
AND
views='#what would go here that states what result of docs would be
shown
based on the user logged in.  If the doc is only to be viewed by
teama,
teamb or everybody???#'
</CFQUERY>



ian





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to