[DB-SIG] cx_Oracle - any way to change the user of a connection?

Harald Armin Massa haraldarminmassa at gmail.com
Sun Aug 13 10:56:46 CEST 2006


I want to have a connections which stays activated:

cn=cx_Oracle.connect("dataset", "lowprivuser", "password")


and change the user of that connection.

Reason: I want to have a web application, which connects ONE TIME (per
process/thread) to Oracle, and switches the privileges on the fly.

I looked into "SET ROLE <ACTIVEUSERax>"; but as much as I understand thats
pureley additional, so:

cn=cx_Oracle.connect("dataset", "lowprivuser", "password")
# gives the privs of "lowprivuser"
cs=cn.cursor()

cs.execute ("SET ROLE USERFISCH identified by secret2006")

then gives the privs of "lowprivuser" plus the privs of  USERFISCH,

and an additional

cs.execute ("SET ROLE USERFOO identified by othersecret")

adds the privs of "USERFOO", WITHOUT loosing those of USERFISCH.


Is there any way to do this?

Best wishes,

Harald






-- 
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Let's set so double the killer delete select all.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/db-sig/attachments/20060813/c5a25b2b/attachment.html 


More information about the DB-SIG mailing list