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

All Samples(81)  |  Call(49)  |  Derive(0)  |  Import(32)
Allow a class and all of its methods to be used from a
restricted Script.  The argument Class must be a class.

        def allow_class(Class):
    """Allow a class and all of its methods to be used from a
    restricted Script.  The argument Class must be a class."""
    Class._security = sec = ClassSecurityInfo()
    sec.declareObjectPublic()
    sec.setDefaultAccess(1)
    sec.apply(Class)
    InitializeClass(Class)
        


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
 
# make DisplayList accessible from python scripts and others objects executed
# in a restricted environment
allow_class(DisplayList)
 
# Allow import of NotFound exception

src/b/e/betahaus.emaillogin-0.6.1/betahaus/emaillogin/__init__.py   betahaus.emaillogin(Download)
def initialize(context):
    from AccessControl import allow_module, allow_class
 
    allow_module('betahaus.emaillogin')
    allow_class(EmailMessageFactory)

src/p/r/Products.Formulator-1.15.5/Products/Formulator/Errors.py   Products.Formulator(Download)
# from Products.Formulator.Errors import ValidationError, FormValidationError
 
from AccessControl import allow_class
 
class FormValidationError(Exception):
        self.result = result
 
allow_class(FormValidationError)
 
class ValidationError(Exception):
        self.error_text = field.get_error_message(error_key)
 
allow_class(ValidationError)
 
class FieldDisabledError(AttributeError):
        self.field = field
 
allow_class(FieldDisabledError)
 

src/e/r/erp5-HEAD/product/ERP5Type/Cache.py   erp5(Download)
from contextlib import contextmanager
from time import time
from AccessControl import allow_class, ClassSecurityInfo
from Acquisition import aq_base
from BTrees.Length import Length
      cp.delete(cache_id, scope)
 
allow_class(CachingMethod)
 
# TransactionCache is a cache per transaction. The purpose of this cache is

src/p/r/Products.slideshowfolder-4.1b1/Products/slideshowfolder/__init__.py   Products.slideshowfolder(Download)
 
# Allow access from restricted python to some modules.
from AccessControl import allow_module, allow_class
allow_module('Products.slideshowfolder.interfaces')
from Products.slideshowfolder.slideshowsetting import SlideShowSettings
allow_class(SlideShowSettings)

src/p/l/plone.sequencebatch-1.0a1/plone/sequencebatch/__init__.py   plone.sequencebatch(Download)
from plone.sequencebatch.batch import Batch
 
from AccessControl import allow_class
from AccessControl import allow_module
 
allow_module('plone.sequencebatch')
allow_class(Batch)

src/p/r/Products.AccessibleReferenceBrowserWidget-1.0a/Products/AccessibleReferenceBrowserWidget/allow.py   Products.AccessibleReferenceBrowserWidget(Download)
from AccessControl import allow_class, allow_module
from implements_arbw import implements_arbw
allow_module('Products.AccessibleReferenceBrowserWidget.implements_arbw')
allow_class(implements_arbw)
 

src/p/l/plone.batching-1.0.2/plone/batching/__init__.py   plone.batching(Download)
from plone.batching.batch import Batch
 
from AccessControl import allow_class
from AccessControl import allow_module
 
allow_module('plone.batching')
allow_class(Batch)

src/c/o/collective.captchaforms-0.1-20090814/collective/captchaforms/__init__.py   collective.captchaforms(Download)
from AccessControl import allow_module, allow_class
from collective.captcha.browser.captcha import Captcha
 
def initialize(context):
	"""Initializer called when used as a Zope 2 product."""
 
	allow_module('collective.captcha.browser.captcha')
	allow_class(Captcha)

src/p/r/Products.MailTemplates-2.0.0/Products/MailTemplates/__init__.py   Products.MailTemplates(Download)
# See license.txt for more details.
 
from AccessControl import allow_module,allow_class
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Products.PageTemplates.PageTemplateFile import guess_type
            obj = getattr(mod,mod_name)
            if isinstance(obj,ClassType):
                allow_class(obj)
 
 

Previous  1 | 2 | 3 | 4  Next