<?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">&gt; 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">&gt;&#160; &gt; 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">&gt;&#160; &gt; REQUEST.form values.</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">&gt;&#160; &gt; </span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">&gt;&#160; &gt; 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">&gt;&#160; &gt; 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">&gt;&#160; &gt; 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">&gt;&#160; &gt; ....</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">&gt;&#160; &gt;&#160;&#160;&#160;&#160; newUser = newUser.__of__(getattr(userFolder,'aq_base', 
userFolder))</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">&gt; </span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">&gt; Try &quot;newUser= newUser.__of__(userFolder)&quot;.</span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">&gt; </span></font></div>
<div align="left"><font face="Arial" color="#000000"><span style="font-size:10pt">&gt; 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">&gt; 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,&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; bkc@murkworks.com&#160;&#160; 
(315)268-1000</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">http://www.murkworks.com&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
(315)268-9812 Fax</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">http://www.wecanstopspam.org/&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
AOL-IM: BKClements</span></font></div>
<div align="left"></div>
</body>
</html>