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

All Samples(78)  |  Call(38)  |  Derive(0)  |  Import(40)

src/c/o/collective.exhibit-1.0a1/collective/exhibit/browser/exhibititem.py   collective.exhibit(Download)
from five import grok
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.PermissionRole import rolesForPermissionOn
from Products.statusmessages.interfaces import IStatusMessage
 
        if (referenced is not None and
              sm.checkPermission('Modify portal content', self.context)):
            view_this = 'Anonymous' in rolesForPermissionOn('View',
                                                            self.context)
            view_ref = 'Anonymous' in rolesForPermissionOn('View', referenced)

src/c/o/collective.portlet.truereview-1.0b1/collective/portlet/truereview/indexer.py   collective.portlet.truereview(Download)
from zope.interface import Interface
from plone.indexer import indexer
 
from AccessControl.PermissionRole import rolesForPermissionOn
 
    allowed = set()
 
    for r in rolesForPermissionOn(permissions.ReviewPortalContent, obj):
        allowed.add(r)
 

src/e/r/erp5-HEAD/product/ERP5Type/Base.py   erp5(Download)
from AccessControl import ClassSecurityInfo
from AccessControl.Permission import pname, Permission
from AccessControl.PermissionRole import rolesForPermissionOn
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.ZopeGuards import guarded_getattr
    If there is more than one Owner local role, the result is undefined.
    """
    if 'Owner' in rolesForPermissionOn(Permissions.View, self):
      owner_list = self.users_with_local_role('Owner')
      if owner_list:

src/e/r/erp5-HEAD/product/ERP5Catalog/CatalogTool.py   erp5(Download)
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
 
from AccessControl.PermissionRole import rolesForPermissionOn
 
from MethodObject import Method
        #   user:<user_id>:<role_id>
        # A line must not be present twice in final result.
        allowed_role_set = set(rolesForPermissionOn('View', ob))
        # XXX the permission name is included by default for verbose
        # logging of security errors, but the catalog does not need to

src/p/r/prdg.zope.permissions-0.0.1/prdg/zope/permissions.py   prdg.zope.permissions(Download)
"""An user-friendlier API for roles and permissions."""
from AccessControl.PermissionRole import rolesForPermissionOn
from AccessControl import getSecurityManager, unauthorized
from Products.CMFCore.utils import getToolByName
 
    # We don't user get_roles_of_permission() because we want to take the
    # acquired ones into account.
    necessary_roles = rolesForPermissionOn(permission, obj)
 
    mtool = getToolByName(obj, 'portal_membership')

src/s/o/Solgema.fullcalendar-2.3.3/Solgema/fullcalendar/catalog.py   Solgema.fullcalendar(Download)
from plone.indexer.decorator import indexer
from zope.interface import Interface
from AccessControl.PermissionRole import rolesForPermissionOn
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.CatalogTool import _mergedLocalRoles
    """
    allowed = {}
    for r in rolesForPermissionOn('Modify portal content', obj):
        allowed[r] = 1
    try:

src/s/o/Solgema.fullcalendar-HEAD/Solgema/fullcalendar/catalog.py   Solgema.fullcalendar(Download)
from plone.indexer.decorator import indexer
from zope.interface import Interface
from AccessControl.PermissionRole import rolesForPermissionOn
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.CatalogTool import _mergedLocalRoles
    """
    allowed = {}
    for r in rolesForPermissionOn('Modify portal content', obj):
        allowed[r] = 1
    try:

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
                perm = all_meta.get(ti.content_meta_type, None)
                if perm is not None:
                    roles = rolesForPermissionOn(perm, container)
 
        else:
            if perm is None:
                continue
            roles = rolesForPermissionOn(perm, context)
        else:
            p = None

src/c/o/collective.zoomit-0.7/collective/zoomit/behavior.py   collective.zoomit(Download)
from five import grok
from z3c.form import button
from AccessControl.PermissionRole import rolesForPermissionOn
from plone.directives import form
from plone.behavior.annotation import AnnotationsFactoryImpl
    def create_content(self):
        # We can only initiate if the image is publicly visible
        if 'Anonymous' not in rolesForPermissionOn('View', self.context):
            # Reset
            self.ready = None
    def _show_create(self):
        return 'Anonymous' in rolesForPermissionOn('View', self.context)
 
    @button.buttonAndHandler(u'Update Status', condition=_show_update)
    def update_image(self, action):

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/utils.py   Products.CMFCore(Download)
 
from AccessControl.Permission import Permission
from AccessControl.PermissionRole import rolesForPermissionOn
from AccessControl.Role import gather_permissions
from AccessControl.SecurityInfo import ClassSecurityInfo
    perm_info = _ac_inherited_permissions(ob, 1)
    for name, settings in map.items():
        cur_roles = rolesForPermissionOn(name, ob)
        if isinstance(cur_roles, basestring):
            cur_roles = [cur_roles]

  1 | 2 | 3 | 4  Next