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

All Samples(209)  |  Call(123)  |  Derive(0)  |  Import(86)
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/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
 
# given as example in Products.PythonScripts.module_access_examples
allow_module('base64')
allow_module('binascii')
allow_module('bisect')
allow_module('colorsys')

src/b/i/bika.lims-3.01a/bika/lims/__init__.py   bika.lims(Download)
from bika.lims.permissions import *
 
from AccessControl import ModuleSecurityInfo, allow_module
from Products.Archetypes.atapi import process_types, listTypes
from Products.CMFCore import utils
from Products.GenericSetup import EXTENSION, profile_registry
 
allow_module('AccessControl')
allow_module('bika.lims')
allow_module('bika.lims.config')
allow_module('bika.lims.permissions')

src/b/i/Bika-LIMS-HEAD/bika/lims/__init__.py   Bika-LIMS(Download)
from bika.lims.permissions import *
 
from AccessControl import ModuleSecurityInfo, allow_module
from Products.Archetypes.atapi import process_types, listTypes
from Products.CMFCore import utils
from Products.GenericSetup import EXTENSION, profile_registry
 
allow_module('AccessControl')
allow_module('bika.lims')
allow_module('bika.lims.config')
allow_module('bika.lims.permissions')

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/__init__.py   Products.CMFPlone(Download)
 
    from AccessControl import ModuleSecurityInfo
    from AccessControl import allow_module, allow_class
 
    # protect OFS.ObjectManager
    ModuleSecurityInfo('urllib').declarePublic('unquote')
 
    allow_module('Products.CMFPlone.utils')
 
    # For content_status_modify
 
    # Make the navtree constructs available TTW
    allow_module('Products.CMFPlone.browser.navtree')
 
    # Allow access to the exception in the folder_delete script
    from OFS.ObjectManager import BeforeDeleteException
    allow_module('OFS.ObjectManager')

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/__init__.py   Products.CMFPlone(Download)
 
    from AccessControl import ModuleSecurityInfo
    from AccessControl import allow_module, allow_class
 
    # protect OFS.ObjectManager
    ModuleSecurityInfo('urllib').declarePublic('unquote')
 
    allow_module('Products.CMFPlone.utils')
 
    # For content_status_modify
 
    # Make the navtree constructs available TTW
    allow_module('Products.CMFPlone.browser.navtree')
 
    # Allow access to the exception in the folder_delete script
    from OFS.ObjectManager import BeforeDeleteException
    allow_module('OFS.ObjectManager')

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/__init__.py   Products.Archetypes(Download)
 
from AccessControl import ModuleSecurityInfo
from AccessControl import allow_class, allow_module
from Products.CMFCore import permissions
 
###
## security
###
# make log and log_exc public
allow_module('Products.Archetypes.utils')

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/__init__.py   Products.Archetypes(Download)
 
from AccessControl import ModuleSecurityInfo
from AccessControl import allow_class, allow_module
from Products.CMFCore import permissions
 
###
## security
###
# make log and log_exc public
allow_module('Products.Archetypes.utils')

src/c/o/collective.emaillogin-1.3/collective/emaillogin/__init__.py   collective.emaillogin(Download)
from AccessControl import getSecurityManager
from AccessControl import Unauthorized
from AccessControl import allow_module
 
from collective.emaillogin import utils as email_utils
# Allow to import utils.py from restricted python , mostly for the
# message factory:
allow_module('collective.emaillogin.utils')
 
# And we use that factory in this init as well:

src/c/h/chimera-0.4.7/Chimera/__init__.py   chimera(Download)
def initialize(context):
    # Zope will trigger this method which will in turn make the
    # chimera runtime available to it.
    from AccessControl import ModuleSecurityInfo, allow_module
    import chimera.pangocairo
    import chimera.fontconfig
    import chimera.chimera
    import chimera
    allow_module('chimera.pangocairo')
    allow_module('chimera.fontconfig')
    allow_module('chimera.pangocairo')
    allow_module('chimera.fontconfig')
    allow_module('chimera.chimera')
    allow_module('chimera')
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next