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

All Samples(5)  |  Call(0)  |  Derive(0)  |  Import(5)

        def guarded_getitem(object, index):
    if type(index) is SliceType:
        if index.step is not None:
            v = object[index]
        else:
            start = index.start
            stop = index.stop
            if start is None:
                start = 0
            if stop is None:
                v = object[start:]
            else:
                v = object[start:stop]
        # We don't guard slices.
        return v
    v = object[index]
    if Containers(type(object)) and Containers(type(v)):
        # Simple type.  Short circuit.
        return v
    if getSecurityManager().validate(object, object, None, v):
        return v
    raise Unauthorized('unauthorized access to element %s' % index)
        


src/f/i/five.pt-2.2.2/src/five/pt/expressions.py   five.pt(Download)
 
from AccessControl.ZopeGuards import guarded_getattr
from AccessControl.ZopeGuards import guarded_getitem
from AccessControl.ZopeGuards import guarded_apply
from AccessControl.ZopeGuards import guarded_iter

src/a/c/AccessControl-3.0.8/src/AccessControl/ImplPython.py   AccessControl(Download)
from AccessControl.SimpleObjectPolicies import Containers
from AccessControl.SimpleObjectPolicies import _noroles
from AccessControl.ZopeGuards import guarded_getitem
 
LOG = getLogger('ImplPython')

src/d/o/DocumentTemplate-2.13.2/src/DocumentTemplate/security.py   DocumentTemplate(Download)
 
from AccessControl.ImplPython import guarded_getattr
from AccessControl.ZopeGuards import guarded_getitem
 
RestrictedDTML = None

src/z/o/Zope2-2.13.22/src/ZTUtils/Zope.py   Zope2(Download)
 
try:
    from AccessControl.ZopeGuards import guarded_getitem
except ImportError:
    Unauthorized = 'Unauthorized'

src/z/o/Zope-HEAD/src/ZTUtils/Zope.py   Zope(Download)
 
try:
    from AccessControl.ZopeGuards import guarded_getitem
except ImportError:
    Unauthorized = 'Unauthorized'