Commit f6f2ffc3 authored by Ivan Tyagov's avatar Ivan Tyagov

Restore security manager to original one instead to no security manager (Anonymous User).

Fix import section.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25333 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 447441d3
...@@ -38,9 +38,8 @@ from zLOG import LOG, INFO, WARNING, ERROR, DEBUG ...@@ -38,9 +38,8 @@ from zLOG import LOG, INFO, WARNING, ERROR, DEBUG
from cStringIO import StringIO from cStringIO import StringIO
from UserDict import UserDict from UserDict import UserDict
import xmlrpclib, socket, sys, traceback, urllib, urllib2, base64, cgi import xmlrpclib, socket, sys, traceback, urllib, urllib2, base64, cgi
from AccessControl.SecurityManagement import newSecurityManager, noSecurityManager from AccessControl.SecurityManagement import newSecurityManager, getSecurityManager, setSecurityManager
import zLOG import zLOG, cookielib
import cookielib
from urlparse import urlparse, urlunparse from urlparse import urlparse, urlunparse
from base64 import encodestring, decodestring from base64 import encodestring, decodestring
from urllib import quote, unquote from urllib import quote, unquote
...@@ -85,8 +84,9 @@ def _getAcCookieFromServer(url, opener, cookiejar, username, password, header_di ...@@ -85,8 +84,9 @@ def _getAcCookieFromServer(url, opener, cookiejar, username, password, header_di
def _setSuperSecurityManager(self): def _setSuperSecurityManager(self):
""" Change to super user account. """ """ Change to super user account. """
user = self.getWrappedOwner() original_security_manager = getSecurityManager()
newSecurityManager(self.REQUEST, user) newSecurityManager(self.REQUEST, self.getWrappedOwner())
return original_security_manager
class GeneratorCall(UserDict): class GeneratorCall(UserDict):
""" Class use to generate/interpret XML-RPC call for the wizard. """ """ Class use to generate/interpret XML-RPC call for the wizard. """
...@@ -521,7 +521,7 @@ class WizardTool(BaseTool): ...@@ -521,7 +521,7 @@ class WizardTool(BaseTool):
global installation_status global installation_status
if use_super_manager: if use_super_manager:
# set current security manager to owner of site # set current security manager to owner of site
_setSuperSecurityManager(self.getPortalObject()) original_security_manager = _setSuperSecurityManager(self.getPortalObject())
portal = self.getPortalObject() portal = self.getPortalObject()
bt5_files = server_response.get("filedata", []) bt5_files = server_response.get("filedata", [])
...@@ -579,7 +579,7 @@ class WizardTool(BaseTool): ...@@ -579,7 +579,7 @@ class WizardTool(BaseTool):
LOG("Wizard", INFO, LOG("Wizard", INFO,
"Completed installation for %s" %' '.join(bt5_filenames)) "Completed installation for %s" %' '.join(bt5_filenames))
if use_super_manager: if use_super_manager:
noSecurityManager() setSecurityManager(original_security_manager)
###################################################### ######################################################
## Navigation ## ## Navigation ##
...@@ -828,10 +828,10 @@ class WizardTool(BaseTool): ...@@ -828,10 +828,10 @@ class WizardTool(BaseTool):
security.declareProtected(Permissions.View, 'getExpressConfigurationPreference') security.declareProtected(Permissions.View, 'getExpressConfigurationPreference')
def getExpressConfigurationPreference(self, preference_id, default = None): def getExpressConfigurationPreference(self, preference_id, default = None):
""" Get Express configuration preference """ """ Get Express configuration preference """
_setSuperSecurityManager(self.getPortalObject()) original_security_manager = _setSuperSecurityManager(self.getPortalObject())
portal_preferences = getToolByName(self, 'portal_preferences') portal_preferences = getToolByName(self, 'portal_preferences')
preference_value = portal_preferences.getPreference(preference_id, default) preference_value = portal_preferences.getPreference(preference_id, default)
noSecurityManager() setSecurityManager(original_security_manager)
return preference_value return preference_value
security.declareProtected(Permissions.ModifyPortalContent, 'setExpressConfigurationPreference') security.declareProtected(Permissions.ModifyPortalContent, 'setExpressConfigurationPreference')
......
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