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

All Samples(7)  |  Call(3)  |  Derive(0)  |  Import(4)
Allow a type and all of its methods and attributes to be used from
restricted code.  The argument Type must be a type.

        def allow_type(Type, allowed=1):
    """Allow a type and all of its methods and attributes to be used from
    restricted code.  The argument Type must be a type."""
    if type(Type) is not type:
        raise ValueError, "%s is not a type" % `Type`
    if hasattr(Type, '__roles__'):
        raise ValueError, "%s handles its own security" % `Type`
    if not (isinstance(allowed, int) or isinstance(allowed, dict)):
        raise ValueError, "The 'allowed' argument must be an int or dict."
    ContainerAssertions[Type] = allowed
        


src/p/r/Products.PythonScripts-2.13.2/src/Products/PythonScripts/module_access_examples.py   Products.PythonScripts(Download)
'''
 
from AccessControl import allow_module, allow_class, allow_type
from AccessControl import ModuleSecurityInfo
 

src/e/r/erp5-HEAD/product/ERP5Type/patches/Restricted.py   erp5(Download)
OrderedDict.__allow_access_to_unprotected_subobjects__ = 1
 
from AccessControl import allow_module, allow_class, allow_type
from AccessControl import ModuleSecurityInfo
 
allow_module('fnmatch')
allow_module('re')
allow_type(type(re.compile('')))
allow_type(type(re.match('x','x')))
 
import cStringIO
f = cStringIO.StringIO()
allow_module('cStringIO')
allow_module('StringIO')
allow_type(type(f))

src/a/r/arecibo-HEAD/clients/plone/clearwind.arecibo/clearwind/arecibo/__init__.py   arecibo(Download)
from AccessControl import allow_module, allow_class, allow_type
from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
 
ModuleSecurityInfo('clearwind.arecibo.wrapper').declarePublic('arecibo')
 

src/c/l/clearwind.arecibo-0.7/clearwind/arecibo/__init__.py   clearwind.arecibo(Download)
from AccessControl import allow_module, allow_class, allow_type
from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
 
ModuleSecurityInfo('clearwind.arecibo.wrapper').declarePublic('arecibo')