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

All Samples(476)  |  Call(297)  |  Derive(0)  |  Import(179)

        def InitializeClass(self):
    from AccessControl.Permission import registerPermissions
    from AccessControl.PermissionRole import PermissionRole
    dict=self.__dict__
    have=dict.has_key
    ft=type(InitializeClass)
    dict_items=dict.items()

    for name, v in dict_items:
        if getattr(v, '_need__name__', 0):
            d = v.__dict__
            oldname = d.get('__name__', '')
            if d.get('_implicit__name__', 0):
                # Already supplied a name.
                if name != oldname:
                    # Tried to implicitly assign a different name!
                    try: classname = '%s.%s' % (
                        self.__module__, self.__name__)
                    except AttributeError: classname = `self`
                    logging.getLogger("Init").warning(
                        'Ambiguous name for method of %s: %r != %r',
                        classname, d['__name__'], name)
            else:
                # Supply a name implicitly so that the method can
                # find the security assertions on its container.
                v._implicit__name__ = 1
                v.__name__ = name
            if name=='manage' or name[:7]=='manage_':
                name=name+'__roles__'
                if not have(name):
                    setattr(self, name, ('Manager',))
        elif name=='manage' or name[:7]=='manage_' and type(v) is ft:
            name=name+'__roles__'
            if not have(name):
                setattr(self, name, ('Manager',))

    # Look for a SecurityInfo object on the class. If found, call its
    # apply() method to generate __ac_permissions__ for the class. We
    # delete the SecurityInfo from the class dict after it has been
    # applied out of paranoia.
    for key, value in dict_items:
        if hasattr(value, '__security_info__'):
            security_info=value
            security_info.apply(self)
            delattr(self, key)
            break

    if self.__dict__.has_key('__ac_permissions__'):
        registerPermissions(self.__ac_permissions__)
        for acp in self.__ac_permissions__:
            pname, mnames = acp[:2]
            if len(acp) > 2:
                roles = acp[2]
                pr = PermissionRole(pname, roles)
            else:
                pr = PermissionRole(pname)
            for mname in mnames:
                setattr(self, mname+'__roles__', pr)
                if (mname and mname not in ('context', 'request') and
                    not hasattr(self, mname)):
                    # don't complain about context or request, as they are
                    # frequently not available as class attributes
                    logging.getLogger("Init").warning(
                        "Class %s.%s has a security declaration for "
                        "nonexistent method %r", self.__module__,
                        self.__name__, mname)
        


src/z/o/Zope-HEAD/src/Products/Sessions/SessionDataManager.py   Zope(Download)
import sys
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from Acquisition import Implicit
            self._requestSessionName = requestSessionName
 
InitializeClass(SessionDataManager)
 
class SessionDataManagerTraverser(Persistent):

src/z/o/Zope-HEAD/src/Products/Sessions/BrowserIdManager.py   Zope(Download)
from urlparse import urlunparse
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from Acquisition import Implicit
            REQUEST.RESPONSE.redirect(self.absolute_url()+msg)
 
InitializeClass(BrowserIdManager)
 
class BrowserIdManagerTraverser(Persistent):

src/z/o/Zope-HEAD/src/Products/PageTemplates/PageTemplateFile.py   Zope(Download)
from logging import getLogger
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
                             "cannot be stored." % self.__class__.__name__)
 
InitializeClass(PageTemplateFile)
 
XML_PREFIXES = [

src/p/r/Products.BastionLedger-4.6.0/Products/BastionLedger/BLForecaster.py   Products.BastionLedger(Download)
        return self.getId()
 
AccessControl.class_init.InitializeClass(BLForecastRecord)
 
manage_addBLForecastForm = PageTemplateFile('zpt/add_forecast', globals())
        return lastOfMonth(self.firstOfMonth())
 
AccessControl.class_init.InitializeClass(BLForecast)
 
class BLForecaster(LargePortalFolder):
        return dates, results, totals
 
AccessControl.class_init.InitializeClass(BLForecaster)
 
def addForecast(ob, event):

src/z/o/Zope-HEAD/src/webdav/Resource.py   Zope(Download)
from AccessControl import getSecurityManager
from AccessControl import ClassSecurityInfo
from AccessControl.class_init import InitializeClass
from AccessControl.Permissions import delete_objects
from AccessControl.Permissions import manage_properties
        return []
 
InitializeClass(Resource)
 

src/z/o/Zope-HEAD/src/webdav/LockItem.py   Zope(Download)
import time
 
from AccessControl.class_init import InitializeClass
from AccessControl.owner import ownerInfo
from AccessControl.SecurityInfo import ClassSecurityInfo
        return s
 
InitializeClass(LockItem)
 

src/z/o/Zope-HEAD/src/webdav/Lockable.py   Zope(Download)
"""
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from Acquisition import aq_base
            self.__no_valid_write_locks__()
 
InitializeClass(LockableItem)
 
 

src/z/o/Zope-HEAD/src/webdav/Collection.py   Zope(Download)
from urllib import unquote
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityManagement import getSecurityManager
from zExceptions import MethodNotAllowed
        return []
 
InitializeClass(Collection)
 

src/z/o/Zope-HEAD/src/OFS/Traversable.py   Zope(Download)
from urllib import quote
 
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
        return self.unrestrictedTraverse(path, default, restricted=True)
 
InitializeClass(Traversable)
 
 

src/z/o/Zope-HEAD/src/OFS/role.py   Zope(Download)
 
from AccessControl import ClassSecurityInfo
from AccessControl.class_init import InitializeClass
from AccessControl.rolemanager import RoleManager as BaseRoleManager
from AccessControl.rolemanager import reqattr
        pass
 
InitializeClass(RoleManager)
 

Previous  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13  Next