<?xml version="1.0" ?><html>
<head>
<title></title>
</head>
<body>
<div align="left"><font face="Arial"><span style="font-size:10pt">On 26 Oct 2003 at 18:33, Dieter Maurer wrote:</span></font></div>
<div align="left"><br/></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">> Brad Clements wrote at 2003-10-26 11:39 -0500:</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">>  > I want to be able to 'su' as another user within Zope if a PythonScript is
called with valid </span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">>  > REQUEST.form values.</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">>  > </span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">>  > Attached below is my extension method, which sorta works. The problem is that
after I </span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">>  > call newSecurityManager, the 'new user' doesn't have View rights to the User
object, so </span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">>  > calling getProperty() on it fails. I'm using LDAPUserFolder</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">>  > ....</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">>  >     newUser = newUser.__of__(getattr(userFolder,'aq_base',
userFolder))</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">> Try "newUser= newUser.__of__(userFolder)".</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">> I am not sure, it will work but at least it is more correct</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">> than your version.</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><br/></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">I had tried that first, it didn't work either. I thought maybe I had to unwrap the user folder
acquired through the context object, that's why I added the getattr cruft. In any case, </span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">newUser= newUser.__of__(userFolder)</span></font></div>
<div align="left"><br/></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">produces the same results</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Thanks for trying to help!</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">-- </span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Brad Clements,                bkc@murkworks.com  
(315)268-1000</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">http://www.murkworks.com                         
(315)268-9812 Fax</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">http://www.wecanstopspam.org/                  
AOL-IM: BKClements</span></font></div>
<div align="left"></div>
</body>
</html>