From 1c4df0bd2656949bf66884e3c67dbea5fd84eebd Mon Sep 17 00:00:00 2001 From: Romain Courteaud <romain@nexedi.com> Date: Wed, 6 Feb 2008 10:05:18 +0000 Subject: [PATCH] It is not possible to get an user folder from special user (like anonymous). So, do not wrap the super_user and do not try to get list of roles. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19091 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/UnrestrictedMethod.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/product/ERP5Type/UnrestrictedMethod.py b/product/ERP5Type/UnrestrictedMethod.py index 7f6e595b6b..faa9162678 100644 --- a/product/ERP5Type/UnrestrictedMethod.py +++ b/product/ERP5Type/UnrestrictedMethod.py @@ -67,17 +67,17 @@ class UnrestrictedMethod(object): def __call__(self, *args, **kw): security_manager = getSecurityManager() user = security_manager.getUser() - uf = user.aq_inner.aq_parent - # XXX is it better to get roles from the parent (i.e. portal)? - role_list = uf.valid_roles() if user.getId() is None: # This is a special user, thus the user is not allowed to own objects. super_user = UnrestrictedUser(user.getUserName(), None, - role_list, user.getDomains()) + user.getRoles(), user.getDomains()) else: + uf = user.aq_inner.aq_parent + # XXX is it better to get roles from the parent (i.e. portal)? + role_list = uf.valid_roles() super_user = PrivilegedUser(user.getId(), None, - role_list, user.getDomains()) - newSecurityManager(None, super_user.__of__(uf)) + role_list, user.getDomains()).__of__(uf) + newSecurityManager(None, super_user) try: return self._m(*args, **kw) finally: -- 2.30.9