[Zope] Authenticated Users and lots of folders

David Hassalevris bluepaul@bluepaul.com
Tue, 29 May 2001 23:45:02 -0700


Tony,

Heres an approach.  
You say you have 85 departments and 1200 staff.
Therefore, you'll have something like 85 categories or codes that will
apply
to something like 1200 users.

Why not setup a database (Gadfly would do?) with a table called
something like userDepts
It could have these fields:
UserID
Dept
Desc?

You would manually add one record for all 1200 or so staff and enter
stuff like:
userID = the users logon ID
Dept = 1550
Desc = 'Medical Faculty"

Now, when your ready to do an Inquiry filtered to the current user you
could do something like:
(bad pseudo code follows)

1) 
 <dtml-in
"zSqlForTheTableAbove(userID=AUTHENICATED_USER.getUserName())">
  <dtml-call "REQUEST.set('userDept',dept)">
</dtml-in>


2) Make the zSQL call you described below now that the users "dept" is
pushed into REQUEST

David
 

Tony McDonald wrote:
> 
> Hi all,
> I need the Zen of the list here, before I go off and implement something
> weird wild and wacky.
> 
> I have a lot of authenticated users (1200 staff, 14000 students).
> The staff are associated with a department.
> There are 85 departments, each with a code (eg 1550 = Medical Faculty)
> I want all authenticated staff to be able to add entries to a database.
> I want some staff to be able to act as 'Editors', that is, allow the
> database entries to be displayed.
> 
> Thing is I *don't* want staff from dept 'a' to be able to act as editors for
> dept 'b'.
> 
> We currently use UserDB to do our cookie based authentication.
> 
> My first thought was to create 85 folders, with ids '1550', '1099' etc and
> install a UserDB into each one of them. Each one of the folders has a
> property 'dept', that is the value of the dept code (eg 1550). I then do a
> ZSQL query something like
> 
> Select username, password, roles, domains from password, dept_code from
> departments where username = <dtml-sqlvar username type=string> and
> dept_code = <dtml-sqlvar dept type=string>
> 
> Does this sound sensible to people?
> Does anyone have a better idea! :)
> 
> (please don't say I need to use CMF - I'm tracking that list, but I can't
> figure out how to extract the various parts of CMF (reviewers etc) to use in
> my situation).
> TIA
> Tone
> --
> Dr Tony McDonald,  Assistant Director, FMCC, http://www.fmcc.org.uk/
> The Medical School, Newcastle University Tel: +44 191 243 6140
> A Zope list for UK HE/FE  http://www.fmcc.org.uk/mailman/listinfo/zope
>