[Zope-dev] Re: Per-user Oracle connections (fwd)

Oleg Broytmann phd@phd.russ.ru
Wed, 2 Feb 2000 09:59:54 +0000 (GMT)


On Mon, 31 Jan 2000, Jim Fulton wrote:
> >    Not a database name - it's fixed - but login/password. Well, I can do
> > it, but how can I pass this information to Connection object?
> 
> Through AUTHENTICATED_USER.  I assume that you'll represent users
> using Zope user objects.  Alternatively, yuo'd have to provide your
> own user authentication logic.

   I am still thinking of different ways. I think I can use
GenericUserFolder, but the question (for me) is - do I need any kind of
UserFolder at all? Finally, it is possible the system woudn't has any
Web-based instruments for managing users (it will not be public portal;
chief manager will assign users, and database programmers may connect
directly to Oracle using SQL*Plus or their Delphi tools and stuff
neccessary information), so it seems I do not need  AUTHENTICATED_USER
object at all...

> > maintain a pool
> > of actual database connections, and pass queries down to
> > db_connection.query(). But how can I find the db_connection? It is an
> > object from my pool of connection, but I need to know 2 things:
> > 
> >    1) login/password; I thing the pool will be just a dictionary indexed by
> > (login, password) tuples. Does this information available in the query()
> > method?
> >    I can stuff login/password into a REQUEST object, but is the REQUEST
> > object available in the query() ?
> 
> You need to select a connection based on a login (or login and password)
> gotten from AUTHENTICATED_USER, which you can get from the request, 
> which you can acquire:
> 
>   user=self.REQUEST['AUTHENTICATED_USER']

   Tthat's exactly the information I needed - aquisition. I was not sure I
can find the REQUEST object using aquisition in a Connection.

   Thanks.

Oleg.
---- 
    Oleg Broytmann      Foundation for Effective Policies      phd@phd.russ.ru
           Programmers don't die, they just GOSUB without RETURN.