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

All Samples(68)  |  Call(36)  |  Derive(0)  |  Import(32)

src/a/c/AccessControl-3.0.8/src/AccessControl/rolemanager.py   AccessControl(Download)
from AccessControl.interfaces import IRoleManager
from AccessControl.Permission import getPermissions
from AccessControl.Permission import Permission
from AccessControl.PermissionMapping import RoleManager
from AccessControl.Permissions import change_permissions
        for p in permissions:
            name, value = p[:2]
            p=Permission(name, value, self)
            roles = p.getRoles(default=[])
            d={'name': name,
        for p in self.ac_inherited_permissions(1):
            name, value = p[:2]
            p=Permission(name, value, self)
            p.setRole(role_to_manage, name in permissions)
 
        for p in self.ac_inherited_permissions(1):
            name, value = p[:2]
            p = Permission(name, value, self)
            roles = p.getRoles()
            if roles is None:
            name, value = p[:2]
            if name == permission_to_manage:
                p = Permission(name, value, self)
                if acquire:
                    roles=list(roles)

src/p/r/Products.contentmigration-2.1.8/Products/contentmigration/basemigrator/migrator.py   Products.contentmigration(Download)
from ZODB.POSException import ConflictError
from zExceptions import BadRequest
from AccessControl.Permission import Permission
from AccessControl import SpecialUsers
from Products.CMFCore.utils import getToolByName
        newmap = getPermissionMapping(self.new.ac_inherited_permissions(1))
        for key, values in oldmap.items():
            old_p = Permission(key, values, self.old)
            old_roles = old_p.getRoles()
            new_values = newmap.get(key, ())
            new_p = Permission(key, new_values, self.new)

src/p/r/Products.contentmigration-2.1.8/Products/contentmigration/inplace.py   Products.contentmigration(Download)
from Acquisition import aq_base
from ZODB.POSException import ConflictError
from AccessControl.Permission import Permission
from AccessControl import SpecialUsers
 
        newmap = getPermissionMapping(self.new.ac_inherited_permissions(1))
        for key, values in oldmap.items():
            old_p = Permission(key, values, self.old)
            old_roles = old_p.getRoles(default=_marker)
            if old_roles is _marker:
                continue
            new_values = newmap.get(key, ())
            new_p = Permission(key, new_values, self.new)

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/utils.py   Products.CMFCore(Download)
import sys
 
from AccessControl.Permission import Permission
from AccessControl.PermissionRole import rolesForPermissionOn
from AccessControl.Role import gather_permissions
                    data = d
                    break
            p = Permission(name, data, ob)
            p.setRoles(tuple(cur_roles))
            something_changed = 1

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/FSObject.py   Products.CMFCore(Download)
import os
 
from AccessControl.Permission import Permission
 
try:
        old_info = [x[:2] for x in self.ac_inherited_permissions(1)]
        for old_perm, value in old_info:
            p = Permission(old_perm, value, self)
            acquired = int(isinstance(p.getRoles(default=[]), list))
            rop_info = self.rolesOfPermission(old_perm)

src/e/u/Euphorie-6.3.1/src/euphorie/deployment/upgrade/v2.py   Euphorie(Download)
def resetPublishPermission(context):
    from AccessControl.Permission import Permission
    siteroot = aq_parent(context)
    permission = Permission("Euphorie: Publish a Survey", (), siteroot)
    if "CountryManager" not in permission.getRoles(default=[]):

src/z/o/Zope2-2.13.22/src/OFS/role.py   Zope2(Download)
from AccessControl.rolemanager import RoleManager as BaseRoleManager
from AccessControl.rolemanager import reqattr
from AccessControl.Permission import Permission
from AccessControl.Permissions import change_permissions
from AccessControl.requestmethod import requestmethod
            name, value = permissions[ip][:2]
            try:
                p = Permission(name, value, self)
                if not have('a%d' % ip):
                    roles=tuple(roles)

src/e/r/erp5-HEAD/product/ERP5Type/CopySupport.py   erp5(Download)
from zExceptions import BadRequest
from AccessControl import ClassSecurityInfo, getSecurityManager
from AccessControl.Permission import Permission
from OFS.ObjectManager import ObjectManager
from OFS.CopySupport import CopyContainer as OriginalCopyContainer
      else:
        name, value = (permission, ())
      p = Permission(name,value,context)
      old_role_list = p.getRoles(default=[])
      p.setRoles(user_role_list)

src/z/o/Zope-HEAD/src/OFS/role.py   Zope(Download)
from AccessControl.rolemanager import RoleManager as BaseRoleManager
from AccessControl.rolemanager import reqattr
from AccessControl.Permission import Permission
from AccessControl.Permissions import change_permissions
from AccessControl.requestmethod import requestmethod
            name, value = permissions[ip][:2]
            try:
                p = Permission(name, value, self)
                if not have('a%d' % ip):
                    roles=tuple(roles)

src/c/o/collective.subtractiveworkflow-2.0b1/collective/subtractiveworkflow/workflow.py   collective.subtractiveworkflow(Download)
from zope.interface import implements
 
from AccessControl.Permission import Permission
from AccessControl.PermissionRole import rolesForPermissionOn
 
            break
 
    p = Permission(pname, data, obj)
 
    # Note: tuple = not acquired; list = acquired

  1 | 2 | 3 | 4  Next