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

All Samples(131)  |  Call(84)  |  Derive(0)  |  Import(47)
Set the system default security policy.

This method should only be caused by system startup code. It should
never, for example, be called during a web request.

        def setSecurityPolicy(aSecurityPolicy):
    """Set the system default security policy.

    This method should only be caused by system startup code. It should
    never, for example, be called during a web request.
    """
    last = _ImplPython._defaultPolicy
    _ImplPython._defaultPolicy = aSecurityPolicy
    return last
        


src/p/r/Products.PloneOrg-HEAD/scripts/updateMostSchemata.py   Products.PloneOrg(Download)
 
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
from Testing.makerequest import makerequest
from Products.CMFCore.tests.base.security import PermissiveSecurityPolicy, OmnipotentUser
_policy=PermissiveSecurityPolicy()
_oldpolicy=setSecurityPolicy(_policy)

src/c/o/collective.elasticsearch-HEAD/scripts/populate.py   collective.elasticsearch(Download)
from Testing.makerequest import makerequest
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
from Products.CMFCore.tests.base.security import PermissiveSecurityPolicy, \
    OmnipotentUser
    """
    _policy = PermissiveSecurityPolicy()
    setSecurityPolicy(_policy)
    newSecurityManager(None, OmnipotentUser().__of__(app.acl_users))
    return makerequest(app)

src/o/p/openmultimedia.imagewatchdog-1.0b1/src/openmultimedia/imagewatchdog/script/install_and_migrate.py   openmultimedia.imagewatchdog(Download)
from zope.app.component.hooks import setSite
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
from Testing.makerequest import makerequest
from Products.CMFCore.tests.base.security import (
    """
    _policy = PermissiveSecurityPolicy()
    setSecurityPolicy(_policy)
    newSecurityManager(None, OmnipotentUser().__of__(app.acl_users))
    return makerequest(app)

src/c/o/collective.plonetruegallery-HEAD/importscript.py   collective.plonetruegallery(Download)
from Testing.makerequest import makerequest
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
from Products.CMFCore.tests.base.security import PermissiveSecurityPolicy, \
    OmnipotentUser
    """
    _policy = PermissiveSecurityPolicy()
    setSecurityPolicy(_policy)
    newSecurityManager(None, OmnipotentUser().__of__(app.acl_users))
    return makerequest(app)

src/p/r/Products.PloneSubscription-1.6.3/Products/PloneSubscription/SubscriptionTool.py   Products.PloneSubscription(Download)
from AccessControl import ClassSecurityInfo, getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
from AccessControl.SecurityManagement import noSecurityManager
from DateTime import DateTime

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/tests/test_TypesTool.py   Products.CMFCore(Download)
    def test_constructContent_simple_FTI(self):
        from AccessControl.SecurityManagement import newSecurityManager
        from AccessControl.SecurityManager import setSecurityPolicy
        from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
        from Products.CMFCore.tests.base.dummy import DummyFolder
        from Products.CMFCore.tests.base.tidata import FTIDATA_DUMMY
        site = self._makeSite().__of__(self.root)
        acl_users = site.acl_users
        setSecurityPolicy(self._oldPolicy)
    def test_constructContent_FTI_w_wftool_no_workflows(self):
        from AccessControl.SecurityManagement import newSecurityManager
        from AccessControl.SecurityManager import setSecurityPolicy
        from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
        from Products.CMFCore.tests.base.dummy import DummyFolder
        from Products.CMFCore.tests.base.tidata import FTIDATA_DUMMY
        site = self._makeSite().__of__(self.root)
        acl_users = site.acl_users
        setSecurityPolicy(self._oldPolicy)
    def test_constructContent_FTI_w_wftool_w_workflow_no_guard(self):
        from AccessControl.SecurityManagement import newSecurityManager
        from AccessControl.SecurityManager import setSecurityPolicy
        from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
        from Products.CMFCore.tests.base.dummy import DummyFolder

src/z/o/Zope-HEAD/src/webdav/tests/test_davcmds.py   Zope(Download)
import unittest
 
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
    def setUp(self):
        self._oldPolicy = setSecurityPolicy(_DummySecurityPolicy())
 
    def tearDown(self):
        noSecurityManager()
        setSecurityPolicy(self._oldPolicy)

src/z/o/Zope-HEAD/src/webdav/tests/testResource.py   Zope(Download)
import unittest
 
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
    def setUp(self):
        self.app = DummyContent()
        self._oldPolicy = setSecurityPolicy(_DummySecurityPolicy())
        newSecurityManager(None, object())
 
    def tearDown(self):
        noSecurityManager()
        setSecurityPolicy(self._oldPolicy)

src/z/o/Zope-HEAD/src/Products/PageTemplates/tests/testHTMLTests.py   Zope(Download)
        f.t = AqPageTemplate()
        self.policy = UnitTestSecurityPolicy()
        self.oldPolicy = SecurityManager.setSecurityPolicy( self.policy )
        noSecurityManager()  # Use the new policy.
 
    def tearDown(self):
        super(HTMLTests, self).tearDown()
        SecurityManager.setSecurityPolicy( self.oldPolicy )

src/z/o/Zope-HEAD/src/Products/PageTemplates/tests/testDTMLTests.py   Zope(Download)
        self.t = AqPageTemplate()
        self.policy = UnitTestSecurityPolicy()
        self.oldPolicy = SecurityManager.setSecurityPolicy(self.policy)
        noSecurityManager()  # Use the new policy.
 
    def tearDown(self):
        super(DTMLTests, self).tearDown()
        SecurityManager.setSecurityPolicy(self.oldPolicy)

Previous  1 | 2 | 3 | 4 | 5  Next