Hi ALL,<br><br>I have been doing an authentcation package with signup and login/logout features using PAU. When i refered to philips book and the worldcookery example i found the following codes in the signup logic. <br><br>
class SignUpView(BaseSignUpView):<br><br>&nbsp;&nbsp;&nbsp; signUpForm = ViewPageTemplateFile(&#39;<a href="http://signup.pt">signup.pt</a>&#39;)<br><br>&nbsp;&nbsp;&nbsp; def signUp(self, login, title, password, confirmation):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if confirmation != password:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise UserError(_(u&quot;Password and confirmation didn&#39;t match&quot;))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; folder = self._signupfolder()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if login in folder:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise UserError(_(u&quot;This login has already been chosen.&quot;))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; principal_id = folder.signUp(login, password, title)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role_manager = IPrincipalRoleManager(self.context)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; role_manager = removeSecurityProxy(role_manager) # &lt;- wot does it really do and how does it make the newly<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; # created user to be authenticated automatically<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for role in folder.signup_roles:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role_manager.assignRoleToPrincipal(role, principal_id)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.request.response.redirect(&quot;@@welcome.html&quot;)<br><br>The above logic works well for me too. But if i comment the line &#39;role_manager = removeSecurityProxy(role_manager)&#39;,still user creation and role assignment works. but i am asked to login again right after the signup. and the redirect does not work.<br>
<br>And another apporch i have seen in <br><br><a href="http://kelpi.com/script/e2019a">http://kelpi.com/script/e2019a</a><br><a href="http://kelpi.com/script/f49219">http://kelpi.com/script/f49219</a><br>&nbsp;<br>so i tried to set the principal as<br>
<br>principal=pau.getPrincipal(principal_id)<br>sel.request.setPrincipal(principal)<br><br>and commented the removeSecurityProxy line.<br>But it also gives same result. <br><br>So is there any other way than using removeSecurityProxy(role_manager)? I also would like to know how risky it can be to use removeSecurityProxy in a code with public (zope.public) permission. I Know this is very trivial issue and everyone have gone through this once.<br>
<br>Thanks in advance.<br><br><br>