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

All Samples(26)  |  Call(16)  |  Derive(0)  |  Import(10)
Allow a module and all its contents to be used from a
restricted Script. The argument module_name may be a simple
or dotted module or package name. Note that if a package
path is given, all modules in the path will be available.

        def allow_module(module_name):
    """Allow a module and all its contents to be used from a
    restricted Script. The argument module_name may be a simple
    or dotted module or package name. Note that if a package
    path is given, all modules in the path will be available."""
    ModuleSecurityInfo(module_name).setDefaultAccess(1)
    dot = module_name.find('.')
    while dot > 0:
        ModuleSecurityInfo(module_name[:dot]).setDefaultAccess(1)
        dot = module_name.find('.', dot + 1)
        


src/e/r/erp5-HEAD/product/ERP5Type/__init__.py   erp5(Download)
 
 
from AccessControl.SecurityInfo import allow_module
from AccessControl.SecurityInfo import ModuleSecurityInfo
 
allow_module('Products.ERP5Type.Cache')
    'isValidTALESExpression')
 
allow_module('Products.ERP5Type.Message')
ModuleSecurityInfo('Products.ERP5Type.Message').declarePublic('translateString')
 
allow_module('Products.ERP5Type.Error')
allow_module('Products.ERP5Type.Errors')

src/e/r/erp5-HEAD/product/ERP5OOo/__init__.py   erp5(Download)
# Update ERP5 Globals
from Products.ERP5Type.Utils import initializeProduct, updateGlobals
from AccessControl.SecurityInfo import allow_module
import sys, Permissions
this_module = sys.modules[ __name__ ]
# allow import of various exceptions in restricted environment
# so we can catch them in ZODB scripts and inform user nicely
allow_module('Products.ERP5.Document.Document.ConversionError')
allow_module('xmlrpclib.Fault')
allow_module('socket.error')

src/p/r/Products.MimetypesRegistry-2.0.5/Products/MimetypesRegistry/__init__.py   Products.MimetypesRegistry(Download)
from Products.MimetypesRegistry import MimeTypesRegistry
from AccessControl.SecurityInfo import allow_module, allow_class
 
GLOBALS = globals()
PKG_NAME = 'MimetypesRegistry'
from Products.MimetypesRegistry.common import MimeTypeException
 
allow_module('Products.MimetypesRegistry.common')
allow_class(MimeTypeException)
 

src/e/r/erp5-HEAD/product/CMFActivity/__init__.py   erp5(Download)
cmfactivity_globals = globals()
 
from AccessControl.SecurityInfo import allow_module
allow_module('Products.CMFActivity.ActiveResult')
allow_module('Products.CMFActivity.Errors')

src/e/r/erp5-HEAD/product/ERP5/Tool/__init__.py   erp5(Download)
from AccessControl.SecurityInfo import allow_module
allow_module('Products.ERP5.Tool.NotificationTool')
 

src/e/r/erp5-HEAD/product/ERP5ShortMessage/__init__.py   erp5(Download)
                    content_constructors=content_constructors,
                    content_classes=content_classes)
from AccessControl.SecurityInfo import allow_module
 
allow_module('Products.ERP5ShortMessage.Errors')

src/e/r/erp5-HEAD/product/ERP5Form/__init__.py   erp5(Download)
import sys, Permissions
from Products.PythonScripts.Utility import allow_class
from AccessControl.SecurityInfo import allow_module
this_module = sys.modules[ __name__ ]
document_classes = updateGlobals( this_module, globals(),
ModuleSecurityInfo('Products.ERP5Form.Report').declarePublic('ReportSection',)
ModuleSecurityInfo('Products.ERP5Form.MultiRelationField').declarePublic('SUB_FIELD_ID',)
allow_module('Products.ERP5Form.Selection')
import Selection
allow_class(Selection)

src/a/c/AccessControl-3.0.8/src/AccessControl/__init__.py   AccessControl(Download)
from AccessControl.SecurityInfo import ACCESS_NONE
from AccessControl.SecurityInfo import secureModule
from AccessControl.SecurityInfo import allow_module
from AccessControl.SecurityInfo import allow_class
from AccessControl.SimpleObjectPolicies import allow_type

src/e/r/erp5-HEAD/product/ERP5Type/ConnectionPlugin/SOAPWSDLConnection.py   erp5(Download)
import SOAPpy
from Products.AGProjects.patches import SOAPpy_WSDL as WSDL
from AccessControl.SecurityInfo import allow_class, allow_module
import threading
 

src/f/i/five.pt-2.2.2/src/five/pt/tests/test_pagetemplate.py   five.pt(Download)
            self.fail("Expected unauthorized.")
 
        from AccessControl.SecurityInfo import allow_module
        allow_module("cgi")
        result = template(soup=soup)