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

All Samples(28)  |  Call(17)  |  Derive(0)  |  Import(11)

        def getRoles(container, name, value, default):

    global rolesForPermissionOn  # XXX:  avoid import loop

    if rolesForPermissionOn is None:
        from PermissionRole import rolesForPermissionOn

    roles = getattr(value, '__roles__', _noroles)
    if roles is _noroles:
        if not name or not isinstance(name, basestring):
            return default

        if type(value) is MethodType:
            container = value.im_self

        cls = getattr(container, '__class__', None)
        if cls is None:
            return default
        
        roles = getattr(cls, name+'__roles__', _noroles)
        if roles is _noroles:
            return default

        value = container

    if roles is None or isinstance(roles, tuple_or_list):
        return roles

    # Do not override global variable `rolesForPermissionOn`.
    roles_rolesForPermissionOn = getattr(roles, 'rolesForPermissionOn', None)
    if roles_rolesForPermissionOn is not None:
        roles = roles_rolesForPermissionOn(value)

    return roles
        


src/z/o/Zope2-2.13.22/src/OFS/SimpleItem.py   Zope2(Download)
from AccessControl.Permissions import view as View
from AccessControl.unauthorized import Unauthorized
from AccessControl.ZopeSecurityPolicy import getRoles
from Acquisition import Acquired
from Acquisition import aq_acquire
            if nobody.allowed(
                self.manage_FTPget,
                getRoles(self, 'manage_FTPget', self.manage_FTPget, ()),
                ):
                mode=mode | 0004
            if nobody.allowed(
                self.PUT,
                getRoles(self, 'PUT', self.PUT, ()),
                ):
                mode=mode | 0002

src/z/o/Zope-HEAD/src/OFS/SimpleItem.py   Zope(Download)
from AccessControl.Permissions import view as View
from AccessControl.unauthorized import Unauthorized
from AccessControl.ZopeSecurityPolicy import getRoles
from Acquisition import Acquired
from Acquisition import aq_acquire
            if nobody.allowed(
                self.manage_FTPget,
                getRoles(self, 'manage_FTPget', self.manage_FTPget, ()),
                ):
                mode=mode | 0004
            if nobody.allowed(
                self.PUT,
                getRoles(self, 'PUT', self.PUT, ()),
                ):
                mode=mode | 0002

src/i/n/infrae.wsgi-2.2.1/src/infrae/wsgi/traverser.py   infrae.wsgi(Download)
from zope.publisher.interfaces.browser import IBrowserPublisher
 
from AccessControl.ZopeSecurityPolicy import getRoles
from ZPublisher.BaseRequest import UNSPECIFIED_ROLES, DefaultPublishTraverse
from ZPublisher.BaseRequest import quote
    def __init__(self, context, request):
        self.request = request
        self.context = context
        self.roles = getRoles(None, None, context, UNSPECIFIED_ROLES)
 
                    if next_content is not content:
                        self.roles = getRoles(
                            content, None, next_content, self.roles)
                        content = next_content
 
 
                self.roles = getRoles(
                    content, check_name, next_content, self.roles)
                content = next_content
 
        if hasattr(content, '__call__'):
            self.roles = getRoles(
                content, '__call__', content.__call__, self.roles)
        request.roles = self.roles
 

src/a/c/AccessControl-3.0.8/src/AccessControl/ImplPython.py   AccessControl(Download)
#          do the indirection.
#
from AccessControl.ZopeSecurityPolicy import getRoles  # XXX
 
class ZopeSecurityPolicy:
 
        if roles is _noroles:
            roles = getRoles(container, name, value, _noroles)
 
        ############################################################

src/r/e/repoze.zope2-1.0.3/repoze/zope2/z2bob.py   repoze.zope2(Download)
    from zope.app.traversing.interfaces import TraversalError
 
from AccessControl.ZopeSecurityPolicy import getRoles
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
        trns.reverse()
        request.path = request['TraversalRequestNameStack'] = trns
        request.roles = getRoles(None, None, self.root, UNSPECIFIED_ROLES)
        self.request = request
 
                raise httpexceptions.HTTPNotFound(name)
 
        request.roles = getRoles(ob, name, ob2, request.roles)
        self.traversed.append(name)
 
 
        if hasattr(published, '__call__'):
            request.roles = getRoles(published, '__call__',
                                     published.__call__, request.roles)
 

src/e/x/experimental.contentcreation-1.0rc1/experimental/contentcreation/patches.py   experimental.contentcreation(Download)
from AccessControl import getSecurityManager
from AccessControl.PermissionRole import rolesForPermissionOn
from AccessControl.ZopeSecurityPolicy import getRoles
from Acquisition import aq_parent
from Acquisition import aq_base
                continue
 
            roles = getRoles(p, ti.factory, m, [])
 
 
                continue
 
            roles = getRoles(p, ti.factory, m, [])
 
        if [r for r in roles if rolesInContext.has_key(r)]:

src/z/o/Zope2-2.13.22/src/OFS/ObjectManager.py   Zope2(Download)
from AccessControl.Permissions import import_export_objects
from AccessControl import getSecurityManager
from AccessControl.ZopeSecurityPolicy import getRoles
from Acquisition import aq_base
from Acquisition import Implicit
            if nobody.allowed(
                self,
                getRoles(self, 'manage_FTPlist', self.manage_FTPlist, ())):
                mode=mode | 0007
        mtime=self.bobobase_modification_time().timeTime()

src/z/o/Zope-HEAD/src/OFS/ObjectManager.py   Zope(Download)
from AccessControl.Permissions import import_export_objects
from AccessControl import getSecurityManager
from AccessControl.ZopeSecurityPolicy import getRoles
from Acquisition import aq_base
from Acquisition import Implicit
            if nobody.allowed(
                self,
                getRoles(self, 'manage_FTPlist', self.manage_FTPlist, ())):
                mode=mode | 0007
        if hasattr(aq_base(self), '_p_mtime'):

src/z/o/Zope2-2.13.22/src/ZPublisher/BaseRequest.py   Zope2(Download)
 
try:
    from AccessControl.ZopeSecurityPolicy import getRoles
except ImportError:
    def getRoles(container, name, value, default):

src/z/o/Zope-HEAD/src/ZPublisher/BaseRequest.py   Zope(Download)
 
try:
    from AccessControl.ZopeSecurityPolicy import getRoles
except ImportError:
    def getRoles(container, name, value, default):

  1 | 2  Next