[PLIP-Advisories] Re: [Plone] #9310: User registration process more flexible
plip-advisories at lists.plone.org
plip-advisories at lists.plone.org
Sun Sep 20 11:17:46 UTC 2009
#9310: User registration process more flexible
---------------------+------------------------------------------------------
Reporter: dokter | Owner: dokter
Type: PLIP | Status: assigned
Priority: minor | Milestone: 4.0
Component: Unknown | Resolution:
Keywords: |
---------------------+------------------------------------------------------
Comment(by khink):
The "Error: REQUEST" happens after the new user is created. This happens
finally in
'Products.PlonePAS.plugins.role.getRolesForPrincipal', which assumes it
has a 'REQUEST' on it. It doesn't. Also, the method takes an optional
'request' argument, which doesn't seem to be used.
I'm not sure what the idea behind this is. The attached patch fixes the
"Error: REQUEST". It simply tests if 'self' has a 'REQUEST' attr, before
trying to fetch it. As this may have consequences, i would like a second
opinion on this.
{{{
Index: Products.PlonePAS/Products/PlonePAS/plugins/role.py
===================================================================
--- Products.PlonePAS/Products/PlonePAS/plugins/role.py (revision 97735)
+++ Products.PlonePAS/Products/PlonePAS/plugins/role.py (working copy)
@@ -112,8 +112,9 @@
# the ones he got through his groups. In this case, the
# '__ignore_group_roles__'= True should be previously pushed
# in the request.
- if not self.REQUEST.get('__ignore_group_roles__', False) and
hasattr(principal, 'getGroups'):
- principal_ids.extend( principal.getGroups() )
+ if hasattr(self, 'REQUEST'):
+ if not self.REQUEST.get('__ignore_group_roles__', False) and
hasattr(principal, 'getGroups'):
+ principal_ids.extend( principal.getGroups() )
for pid in principal_ids:
roles.extend( self._principal_roles.get( pid, () ) )
return tuple( unique( roles ) )
}}}
--
Ticket URL: <http://dev.plone.org/plone/ticket/9310#comment:37>
Plone <http://plone.org>
Plone Content Management System
More information about the PLIP-Advisories
mailing list