Commit de136f96 authored by Ivan Tyagov's avatar Ivan Tyagov

Extend API for function.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25662 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8aa89df4
......@@ -85,10 +85,17 @@ def _getAcCookieFromServer(url, opener, cookiejar, username, password, header_di
f = opener.open(request)
return f
def _setSuperSecurityManager(self):
""" Change to super user account. """
def _setSuperSecurityManager(self, user_name=None):
""" Change to super user account or passed user_name.
Return original Security Manager
"""
original_security_manager = getSecurityManager()
newSecurityManager(self.REQUEST, self.getWrappedOwner())
if user_name is not None:
user_folder = self.getPortalObject().acl_users
user = user_folder.getUserById(user_name).__of__(user_folder)
else:
user = self.getWrappedOwner()
newSecurityManager(self.REQUEST, user)
return original_security_manager
class GeneratorCall(UserDict):
......
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