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/u/Euphorie-6.3.1/src/euphorie/content/tests/utils.py   Euphorie(Download)
from Acquisition import aq_parent
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
 
        return sector
    finally:
        setSecurityManager(sm)
 
 

src/s/l/slapos.core-HEAD/master/bt5/slapos_erp5/TestTemplateItem/testSlapOSERP5DefaultScenario.py   slapos.core(Download)
import re
import xml_marshaller
from AccessControl.SecurityManagement import getSecurityManager, \
             setSecurityManager
from DateTime import DateTime
          len(computer.contentValues(portal_type='Computer Partition')))
    finally:
      setSecurityManager(sm)
 
  def simulateSlapgridSR(self, computer):
						computer.getReference())
    finally:
      setSecurityManager(sm)
    self.tic()
 
          destroyed_partition_id_list.append(partition._partition_id.encode("UTF-8"))
    finally:
      setSecurityManager(sm)
    self.tic()
    self.stepCallSlaposFreeComputerPartitionAlarm()
 
          finally:
            setSecurityManager(oldsm)
    finally:
      setSecurityManager(sm)

src/p/l/plone.api-1.1.0/parts/omelette/plone/api/tests/test_env.py   plone.api(Download)
    def tearDown(self):
        """Shared test environment clean-up, ran after every test."""
        AccessControl.SecurityManagement.setSecurityManager(self._old_sm)
 
    def should_allow(self, names):

src/z/o/Zope2-2.13.22/src/Testing/ZopeTestCase/functional.py   Zope2(Download)
    '''
    from AccessControl.SecurityManagement import getSecurityManager
    from AccessControl.SecurityManagement import setSecurityManager
    from zope.site.hooks import getSite
    from zope.site.hooks import setSite
            return func(*args, **kw)
        finally:
            setSecurityManager(sm)
            setSite(site)
    return wrapped_func

src/i/n/infrae.wsgi-2.2.1/src/infrae/wsgi/testing/layer.py   infrae.wsgi(Download)
import base64
 
from AccessControl.SecurityManagement import (
    getSecurityManager, setSecurityManager, noSecurityManager)
from zope.site.hooks import getSite, setSite, setHooks
            setHooks()
        if self.__security is not None:
            setSecurityManager(self.__security)
        self.connection.sync()
 

src/p/l/plone.api-1.1.0/src/plone/api/tests/test_env.py   plone.api(Download)
    def tearDown(self):
        """Shared test environment clean-up, ran after every test."""
        AccessControl.SecurityManagement.setSecurityManager(self._old_sm)
 
    def should_allow(self, names):

src/z/o/Zope-HEAD/src/Testing/ZopeTestCase/functional.py   Zope(Download)
    '''
    from AccessControl.SecurityManagement import getSecurityManager
    from AccessControl.SecurityManagement import setSecurityManager
    from zope.component.hooks import getSite
    from zope.component.hooks import setSite
            return func(*args, **kw)
        finally:
            setSecurityManager(sm)
            setSite(site)
    return wrapped_func

src/p/r/Products.ZCatalog-3.0.2/src/Products/ZCatalog/tests/test_zcatalog.py   Products.ZCatalog(Download)
import unittest
 
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl import Unauthorized
        # allow all accesses
        pickySecurityManager = PickySecurityManager()
        setSecurityManager(pickySecurityManager)
        self.assertEqual(brain.getObject().getId(), 'ob')
        # disallow just 'ob' access
        pickySecurityManager = PickySecurityManager(['ob'])
        setSecurityManager(pickySecurityManager)
        # disallow just 'fold' access
        pickySecurityManager = PickySecurityManager(['fold'])
        setSecurityManager(pickySecurityManager)
        ob = brain.getObject()
        self.assertFalse(ob is None)
        # allow all accesses
        pickySecurityManager = PickySecurityManager()
        setSecurityManager(pickySecurityManager)
        self.assertEqual(brain._unrestrictedGetObject().getId(), 'ob')
        # disallow just 'ob' access

src/e/r/erp5-HEAD/product/ERP5Type/tests/ERP5TypeTestCase.py   erp5(Download)
 
        from AccessControl.SecurityManagement import getSecurityManager
        from AccessControl.SecurityManagement import setSecurityManager
 
        # Save current security manager
 
        # Restore security manager
        setSecurityManager(sm)
 
        return ResponseWrapper(response, outstream, path)

src/f/t/ftw.bridge.client-1.0.8/ftw/bridge/client/tests/test_add_watcher_view.py   ftw.bridge.client(Download)
 
        finally:
            SecurityManagement.setSecurityManager(sm)
 

Previous  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13  Next