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

All Samples(16)  |  Call(10)  |  Derive(0)  |  Import(6)
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/e/r/erp5-HEAD/product/ERP5Type/Utils.py   erp5(Download)
 
from AccessControl import ModuleSecurityInfo
from AccessControl.SecurityInfo import allow_class
from AccessControl import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
    GenericSum.__init__(self, md5_new(*args))
 
allow_class(md5)
 
class sha(GenericSum):
  def __init__(self, *args):
    GenericSum.__init__(self, sha_new(*args))
 
allow_class(sha)
  class SambaPassword:
    pass
allow_class(SambaPassword)
 
#####################################################

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'
 
allow_module('Products.MimetypesRegistry.common')
allow_class(MimeTypeException)
 
def initialize(context):

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
 
       self.name, self.code, self.info)
 
allow_class(SOAPWSDLException)
 
# Authentication classes.
    return {'auth': self._auth}
 
allow_class(HeaderAuthentication)
 
# Wrappers for SOAPpy objects.

src/e/r/erp5-HEAD/product/ERP5Form/PDFForm.py   erp5(Download)
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping, DTMLFile
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityInfo import allow_class
 
from zLOG import LOG, PROBLEM, WARNING
    return self.__values[attr]
  __getattr__ = __getitem__
allow_class(CalculatedValues)
 
 
class EmptyERP5PdfFormError(Exception):
  """Error thrown when you try to display an empty Pdf. """
allow_class(EmptyERP5PdfFormError)
 
 

src/e/r/erp5-HEAD/product/ZSQLCatalog/Extensions/zsqlbrain.py   erp5(Download)
 
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityInfo import allow_class
 
from zLOG import LOG, WARNING
        self.getPath(), activity, active_process, **new_kw)
 
allow_class(ZSQLBrain)
 
class ZSQLBrainNoObject(ZSQLBrain):
                                                             self.getPath(), 
                                                             stack))
allow_class(ZSQLBrainNoObject)
 
 

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