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

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Con zope.security to use Zope 2's checkPermission.

zope.security when it does a checkPermission will turn around and
ask the thread local interaction for the checkPermission method.
By making the interaction *be* Zope 2's security manager, we can
con zope.security into using Zope 2's checker...

        def newInteraction():
    """Con zope.security to use Zope 2's checkPermission.

    zope.security when it does a checkPermission will turn around and
    ask the thread local interaction for the checkPermission method.
    By making the interaction *be* Zope 2's security manager, we can
    con zope.security into using Zope 2's checker...
    """
    if getattr(thread_local, 'interaction', None) is None:
        thread_local.interaction = SecurityPolicy()
        


src/z/o/Zope-HEAD/src/Testing/ZopeTestCase/placeless.py   Zope(Download)
from zope.i18n.testing import PlacelessSetup as I18nPlacelessSetup
from zope.security.testing import addCheckerPublic
from AccessControl.security import newInteraction
 
 
 
        addCheckerPublic()
        newInteraction()
 
 

src/z/o/Zope2-2.13.22/src/Testing/ZopeTestCase/placeless.py   Zope2(Download)
from zope.i18n.testing import PlacelessSetup as I18nPlacelessSetup
from zope.security.testing import addCheckerPublic
from AccessControl.security import newInteraction
 
 
 
        addCheckerPublic()
        newInteraction()