Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(271)  |  Call(158)  |  Derive(0)  |  Import(113)
install *manager* as current security manager for this thread.

        def setSecurityManager(manager):
    """install *manager* as current security manager for this thread."""
    thread_id=get_ident()
    _managers[thread_id]=manager
        


src/e/r/erp5-HEAD/product/ERP5Form/PreferenceTool.py   erp5(Download)
 
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager,\
                          setSecurityManager, newSecurityManager
from MethodObject import Method
      return tv[tv_key]
    finally:
      setSecurityManager(security_manager)
 
  def _getActivePreferenceByPortalType(self, portal_type):
      return preference
    finally:
      setSecurityManager(security_manager)
 
  security.declarePublic('isAuthenticationPolicyEnabled')

src/e/r/erp5-HEAD/product/ERP5ShortMessage/Document/MobytGateway.py   erp5(Download)
from AccessControl import ClassSecurityInfo, \
                          Unauthorized 
from AccessControl.SecurityManagement import  getSecurityManager, \
                                              setSecurityManager, \
                                              newSecurityManager 
      finally:
        #Restore orinal user
        setSecurityManager(sm)
 
 

src/e/r/erp5-HEAD/product/ERP5ShortMessage/Document/DummyGateway.py   erp5(Download)
from AccessControl import ClassSecurityInfo, \
                          Unauthorized 
from AccessControl.SecurityManagement import  getSecurityManager, \
                                              setSecurityManager, \
                                              newSecurityManager 
      finally:
        #Restore orinal user
        setSecurityManager(sm)
 
 

src/e/r/erp5-HEAD/product/ERP5/Tool/AlarmTool.py   erp5(Download)
 
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager, \
        newSecurityManager, setSecurityManager
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping
          alarm.activeSense()
    finally:
      setSecurityManager(security_manager)
 
  security.declarePrivate('process_timer')

src/e/r/erp5-HEAD/product/ERP5/Document/Delivery.py   erp5(Download)
 
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager, \
    setSecurityManager, newSecurityManager
from AccessControl.User import nobody
        unrestricted_apply(self.activate(after_tag=after_tag, **kw)._localBuild)
      finally:
        setSecurityManager(sm)
 
    def _localBuild(self):

src/e/r/erp5-HEAD/product/ERP5/Document/Alarm.py   erp5(Download)
from DateTime import DateTime
from AccessControl import ClassSecurityInfo, Unauthorized
from AccessControl.SecurityManagement import getSecurityManager, \
            setSecurityManager, newSecurityManager
from AccessControl.User import nobody
    finally:
      # Restore the original user.
      setSecurityManager(sm)
 
  security.declareProtected(Permissions.ManagePortal, 'sense')

src/e/r/erp5-HEAD/product/ERP5Security/ERP5ExternalOauth2ExtractionPlugin.py   erp5(Download)
from Products.ERP5Security.ERP5UserManager import SUPER_USER
from Products.PluggableAuthService.PluggableAuthService import DumbHTTPExtractor
from AccessControl.SecurityManagement import getSecurityManager,\
    setSecurityManager, newSecurityManager
from Products.ERP5Type.Cache import DEFAULT_CACHE_SCOPE
            raise
        finally:
          setSecurityManager(sm)
    try:
      self.setToken(self.prefix + token, user)

src/e/r/erp5-HEAD/product/ERP5Security/ERP5BearerExtractionPlugin.py   erp5(Download)
from Products.ERP5Security.ERP5UserManager import SUPER_USER
from Products.PluggableAuthService.PluggableAuthService import DumbHTTPExtractor
from AccessControl.SecurityManagement import getSecurityManager,\
    setSecurityManager, newSecurityManager
 
          creds['external_login'] = reference
      finally:
        setSecurityManager(sm)
      if 'external_login' in  creds:
        creds['remote_host'] = request.get('REMOTE_HOST', '')

src/e/r/erp5-HEAD/product/CMFActivity/ActivityTool.py   erp5(Download)
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.User import system as system_user
            result = method(*self.args, **self.kw)
        finally:
          setSecurityManager(old_security_manager)
 
        if method is not None:
    finally:
      # Use again the previous user
      setSecurityManager(old_security_manager)
 
  def setExecutionState(self, is_executed, exc_info=None, log=True, context=None):
                error=sys.exc_info())
          finally:
            setSecurityManager(old_sm)
        finally:
          timerservice_lock.release()

src/u/w/uwosh.pfg.d2c-2.4.3/uwosh/pfg/d2c/content/dataentry.py   uwosh.pfg.d2c(Download)
 
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import \
    newSecurityManager, getSecurityManager, setSecurityManager
 
                value = adapter.getDynamicTitle(
                    expression_context=exprcontext)
                setSecurityManager(old_security_manager)
                return value
            except Exception:
                # make sure original security manager is reinstated.
                setSecurityManager(old_security_manager)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next