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

All Samples(1131)  |  Call(659)  |  Derive(0)  |  Import(472)
Set up a new security context for a request for a user
    

        def newSecurityManager(request, user):
    """Set up a new security context for a request for a user
    """
    thread_id=get_ident()
    _managers[thread_id]=SecurityManager(
        thread_id,
        SecurityContext(user),
        )
        


src/p/r/Products.sampleremember-1.1b2/Products/sampleremember/tests/base.py   Products.sampleremember(Download)
from zope.app.component.hooks import setSite, setHooks
 
import transaction as txn
 
from AccessControl.SecurityManagement import newSecurityManager
        # add all our remember members (as portal_owner)
        user = app.acl_users.getUser('portal_owner')
        newSecurityManager(None, user)
 
        for mem_id in mem_data:

src/e/r/erp5-HEAD/product/CMFActivity/ActivityTool.py   erp5(Download)
from Products.PythonScripts.Utility import allow_class
from AccessControl import ClassSecurityInfo, Permissions
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
    if user is not None:
      user = user.__of__(uf)
      newSecurityManager(None, user)
    else :
      LOG("CMFActivity", WARNING,
            # have the permission to invoke all activities
            user = self.portal_catalog.getWrappedOwner()
            newSecurityManager(self.REQUEST, user)
 
            currentNode = self.getCurrentNode()

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
      actual_user = acl_users.getUser(str(user))
      if actual_user is not None:
        newSecurityManager(None, actual_user.__of__(acl_users))
      tv_key = 'PreferenceTool._getSortedPreferenceList/%s/%s' % (user,
                                                                  sql_catalog_id)
      if user is None:
        raise ValueError("User %r not found" % (username, ))
      newSecurityManager(None, user.__of__(user_folder))
      preference = self.newContent(portal_type='Preference')
      if enable:

src/e/r/erp5-HEAD/product/ERP5ShortMessage/Document/MobytGateway.py   erp5(Download)
from AccessControl import ClassSecurityInfo, \
                          Unauthorized 
from AccessControl.SecurityManagement import  getSecurityManager, \
                                              setSecurityManager, \
                                              newSecurityManager 
        #Use SUPER_USER
        portal_membership = self.getPortalObject().portal_membership
        newSecurityManager(None, portal_membership.getMemberById(SUPER_USER)) 
 
        #Mobyt notify only new SMS   

src/e/r/erp5-HEAD/product/ERP5ShortMessage/Document/DummyGateway.py   erp5(Download)
from AccessControl import ClassSecurityInfo, \
                          Unauthorized 
from AccessControl.SecurityManagement import  getSecurityManager, \
                                              setSecurityManager, \
                                              newSecurityManager 
        #Use SUPER_USER
        portal_membership = self.getPortalObject().portal_membership
        newSecurityManager(None, portal_membership.getMemberById(SUPER_USER)) 
 
        #Dummy notify only new SMS   

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
        if alarm is not None:
          user = alarm.getWrappedOwner()
          newSecurityManager(self.REQUEST, user)
          if alarm.isActive() or not alarm.isEnabled():
            # do nothing if already active, or not enabled

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
      after_tag.append('expand:' + self.getPath())
      sm = getSecurityManager()
      newSecurityManager(None, nobody)
      try:
        unrestricted_apply(self.activate(after_tag=after_tag, **kw)._localBuild)

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
    # is always invoked by system user.
    sm = getSecurityManager()
    newSecurityManager(None, nobody)
    try:
      _activeSense()

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
        sm = getSecurityManager()
        if sm.getUser().getId() != SUPER_USER:
          newSecurityManager(self, self.getUser(SUPER_USER))
        try:
          self.REQUEST['USER_CREATION_IN_PROGRESS'] = 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
 
      sm = getSecurityManager()
      if sm.getUser().getId() != SUPER_USER:
        newSecurityManager(self, self.getUser(SUPER_USER))
      try:
        reference = self.Base_extractBearerTokenInformation(token)

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