Commit a22d2d6c authored by Jérome Perrin's avatar Jérome Perrin

unconditionally reset the secturiy manager on failures.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10611 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 200db3d1
...@@ -87,7 +87,7 @@ class ERP5GroupManager(BasePlugin): ...@@ -87,7 +87,7 @@ class ERP5GroupManager(BasePlugin):
sm = getSecurityManager() sm = getSecurityManager()
if sm.getUser() != SUPER_USER: if sm.getUser() != SUPER_USER:
newSecurityManager(self, self.getUser(SUPER_USER)) newSecurityManager(self, self.getUser(SUPER_USER))
try:
# To get the complete list of groups, we try to call the # To get the complete list of groups, we try to call the
# ERP5Type_getSecurityCategoryMapping which should return a list # ERP5Type_getSecurityCategoryMapping which should return a list
# of lists of two elements (script, base_category_list) like : # of lists of two elements (script, base_category_list) like :
...@@ -120,7 +120,6 @@ class ERP5GroupManager(BasePlugin): ...@@ -120,7 +120,6 @@ class ERP5GroupManager(BasePlugin):
login is %s : %s' % (user_name, login is %s : %s' % (user_name,
repr([r.getObject() for r in catalog_result])) repr([r.getObject() for r in catalog_result]))
else: # no person is linked to this user login else: # no person is linked to this user login
setSecurityManager(sm)
return () return ()
person_object = catalog_result[0].getObject() person_object = catalog_result[0].getObject()
person_id = person_object.getId() person_id = person_object.getId()
...@@ -179,7 +178,7 @@ class ERP5GroupManager(BasePlugin): ...@@ -179,7 +178,7 @@ class ERP5GroupManager(BasePlugin):
'could not get security groups from ' 'could not get security groups from '
'ERP5Type_asSecurityGroupId', 'ERP5Type_asSecurityGroupId',
error = sys.exc_info()) error = sys.exc_info())
finally:
setSecurityManager(sm) setSecurityManager(sm)
return tuple(security_group_list) return tuple(security_group_list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment