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

All Samples(26)  |  Call(17)  |  Derive(0)  |  Import(9)

        def pname(name, translate=string.translate, name_trans=name_trans):
    return '_'+translate(name, name_trans) + "_Permission"
        


src/p/r/Products.PluggableAuthService-1.10.0/Products/PluggableAuthService/permissions.py   Products.PluggableAuthService(Download)
        # BBB This is in AccessControl starting in Zope 2.13
        from AccessControl.Permission import _registeredPermissions
        from AccessControl.Permission import pname
        from AccessControl.Permission import ApplicationDefaultPermissions
        import Products
            Products.__ac_permissions__=(
                Products.__ac_permissions__+((permission,(),roles),))
            mangled = pname(permission)
            setattr(ApplicationDefaultPermissions, mangled, roles)
 

src/c/o/collective.autopermission-1.0b2/collective/autopermission/permissions.py   collective.autopermission(Download)
import Products
from AccessControl.Permission import _registeredPermissions
from AccessControl.Permission import pname
from AccessControl.Permission import ApplicationDefaultPermissions
 
        Products.__ac_permissions__ = (
            Products.__ac_permissions__ + ((permission, (), roles),))
        mangled = pname(permission)
        setattr(ApplicationDefaultPermissions, mangled, roles)
 

src/e/r/erp5-HEAD/product/ERP5Type/Tool/ComponentTool.py   erp5(Download)
    # XXX-Cosmetic: From Zope >= 2.13, getPermissions() can be used instead of
    # protected _registeredPermissions module attribute
    from AccessControl.Permission import _registeredPermissions, pname
    for permission_name in _registeredPermissions:
      if permission_name == 'Reset dynamic classes':
        permission_function = lambda self: ('Developer',)
 
      setattr(cls, pname(permission_name), property(permission_function))
 
  def _isBootstrapRequired(self):

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/permissions.py   Products.CMFCore(Download)
from AccessControl.Permission import _registeredPermissions
from AccessControl.Permission import ApplicationDefaultPermissions
from AccessControl.Permission import pname
from AccessControl.SecurityInfo import ModuleSecurityInfo
 
            Products.__ac_permissions__=(
                Products.__ac_permissions__+((permission,(),roles),))
            mangled = pname(permission)
            setattr(ApplicationDefaultPermissions, mangled, roles)
 

src/a/c/AccessControl-3.0.8/src/AccessControl/PermissionMapping.py   AccessControl(Download)
from AccessControl.interfaces import IPermissionMappingSupport
from AccessControl.owner import UnownableOwner
from AccessControl.Permission import pname
from AccessControl.requestmethod import requestmethod
 
        perms={}
        for p in self.possible_permissions():
            perms[pname(p)]=p
 
        r=[]
def getPermissionMapping(name, obj, st=type('')):
    obj=getattr(obj, 'aq_base', obj)
    name=pname(name)
    r=getattr(obj, name, '')
    if type(r) is not st: r=''
    return r
 
def setPermissionMapping(name, obj, v):
    name=pname(name)
    if v: setattr(obj, name, pname(v))

src/p/r/Products.WatermarkImage-1.0/Products/WatermarkImage/permissions.py   Products.WatermarkImage(Download)
from AccessControl import Permissions
from AccessControl.Permission import _registeredPermissions
from AccessControl.Permission import pname
from Globals import ApplicationDefaultPermissions
 
        Products.__ac_permissions__=(
            Products.__ac_permissions__+((permission,(),roles),))
        mangled = pname(permission)
        setattr(ApplicationDefaultPermissions, mangled, roles)
 

src/e/r/erp5-HEAD/product/ERP5Type/Base.py   erp5(Download)
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
from AccessControl.Permission import pname, Permission
from AccessControl.PermissionRole import rolesForPermissionOn
from AccessControl.SecurityManagement import getSecurityManager
    local_permission_list = ()
    for permission in self.possible_permissions():
      permission_role = getattr(self,pname(permission),None)
      if permission_role is not None:
        local_permission_list += ((permission,permission_role),)
    permissions defined locally
    """
    permission_name = pname(permission)
    if local_permission_list is None:
      if hasattr(self,permission_name):

src/d/m/dm.zopepatches.zclasses-0.1.1/dm/zopepatches/zclasses/Property.py   dm.zopepatches.zclasses(Download)
 
 
from AccessControl.Permission import pname
from AccessControl.Permissions import manage_zclasses
from AccessControl.Permissions import manage_properties
        perms={}
        for p in self.classDefinedAndInheritedPermissions():
            perms[pname(p)]=p
 
        r=[]
        for p in property_sheet_permissions:
            v=getattr(ips, pname(p))
            if name not in property_sheet_permissions: continue
 
            setattr(ips, pname(name), pname(p))
 
        if REQUEST is not None:

src/c/o/collective.securitycleanup-0.3/src/collective/securitycleanup/handler.py   collective.securitycleanup(Download)
        # if the permission was changed in the instance without
        # inspecting the instance dictionary
        if Permission.pname(perm) in obj.__dict__:
            obj.manage_permission(perm, roles=(), acquire=1)
 

src/p/r/Products.BastionLedger-4.6.0/Products/BastionLedger/Permissions.py   Products.BastionLedger(Download)
        Products.__ac_permissions__=(
            Products.__ac_permissions__+((permission,(),roles),))
        mangled = AccessControl.Permission.pname(permission)
        setattr(Globals.ApplicationDefaultPermissions, mangled, roles)
 

  1 | 2  Next