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

All Samples(11)  |  Call(0)  |  Derive(0)  |  Import(11)
Protect the whole class with the given permission

        def protectClass(klass, permission_id):
    """Protect the whole class with the given permission"""
    security = _getSecurity(klass)
    if permission_id == CheckerPublicId or permission_id is CheckerPublic:
        # Sometimes, we already get a processed permission id, which
        # can mean that 'zope.Public' has been interchanged for the
        # CheckerPublic object
        security.declareObjectPublic()
    elif permission_id == CheckerPrivateId:
        security.declareObjectPrivate()
    else:
        permission = getUtility(IPermission, name=permission_id)
        # Zope 2 uses string, not unicode yet
        perm = str(permission.title)
        security.declareObjectProtected(perm)
        


src/z/o/Zope2-2.13.22/src/Products/Five/browser/metaconfigure.py   Zope2(Download)
from AccessControl.class_init import InitializeClass
from AccessControl.security import getSecurityInfo
from AccessControl.security import protectClass
from AccessControl.security import protectName
from AccessControl.security import CheckerPrivateId

src/z/o/Zope-HEAD/src/Products/Five/browser/metaconfigure.py   Zope(Download)
from AccessControl.class_init import InitializeClass
from AccessControl.security import getSecurityInfo
from AccessControl.security import protectClass
from AccessControl.security import protectName
from AccessControl.security import CheckerPrivateId

src/p/r/Products.jsonserver-1.2b6/Products/jsonserver/metaconfigure.py   Products.jsonserver(Download)
    from AccessControl.security import CheckerPrivateId
    from AccessControl.security import getSecurityInfo
    from AccessControl.security import protectClass
    from AccessControl.security import protectName
    from App.class_init import InitializeClass

src/p/l/plone.directives.dexterity-1.0.2/plone/directives/dexterity/form.py   plone.directives.dexterity(Download)
 
try:
    from AccessControl.security import protectClass, protectName
    from AccessControl.security import CheckerPrivateId
    protectClass, protectName, CheckerPrivateId  # pyflakes

src/z/o/Zope2-2.13.22/src/Products/Five/viewlet/metaconfigure.py   Zope2(Download)
 
from AccessControl.class_init import InitializeClass
from AccessControl.security import protectClass
from AccessControl.security import protectName
 

src/z/o/Zope-HEAD/src/Products/Five/viewlet/metaconfigure.py   Zope(Download)
 
from AccessControl.class_init import InitializeClass
from AccessControl.security import protectClass
from AccessControl.security import protectName
 

src/f/i/five.grok-1.3.2/src/five/grok/meta.py   five.grok(Download)
import martian
 
from AccessControl.security import protectClass, protectName
from App.class_init import InitializeClass as initializeClass
 

src/s/i/silva.ui-3.0.3/src/silva/ui/martiansupport/menu.py   silva.ui(Download)
from silva.ui.menu import MenuItem
 
from AccessControl.security import protectClass
from App.class_init import InitializeClass as initializeClass
 

src/k/s/kss.core-1.6.5/kss/core/pluginregistry/_concatresource/meta.py   kss.core(Download)
    __five__ = True
    from App.class_init import InitializeClass
    from AccessControl.security import protectClass
 
 

src/f/i/five.formlib-1.0.4/src/five/formlib/metaconfigure.py   five.formlib(Download)
# BBB Zope 2.12
try:
    from AccessControl.security import protectClass
except ImportError:
    from Products.Five.security import protectClass

  1 | 2  Next