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

All Samples(118)  |  Call(103)  |  Derive(0)  |  Import(15)
PermissionRole C implementation

src/p/r/Products.PlonePAS-5.0/Products/PlonePAS/pas.py   Products.PlonePAS(Download)
from AccessControl.Permissions import manage_users as ManageUsers
from AccessControl.Permissions import manage_properties, change_permissions
from AccessControl.PermissionRole import PermissionRole
 
from Products.PluggableAuthService.PluggableAuthService import \
    postonly(PluggableAuthService._doDelUsers)
PluggableAuthService.userFolderDelUsers__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
 
    postonly(PluggableAuthService._doChangeUser)
PluggableAuthService.userFolderEditUser__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
 
PluggableAuthService.userFolderAddUser = postonly(userFolderAddUser)
PluggableAuthService.userFolderAddUser__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
 
    postonly(PluggableAuthService._doDelGroups)
PluggableAuthService.userFolderDelGroups__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
 

src/p/r/Products.PlonePAS-HEAD/Products/PlonePAS/pas.py   Products.PlonePAS(Download)
from AccessControl.Permissions import manage_users as ManageUsers
from AccessControl.Permissions import manage_properties, change_permissions
from AccessControl.PermissionRole import PermissionRole
 
from Products.PluggableAuthService.PluggableAuthService import \
    postonly(PluggableAuthService._doDelUsers)
PluggableAuthService.userFolderDelUsers__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
 
    postonly(PluggableAuthService._doChangeUser)
PluggableAuthService.userFolderEditUser__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
 
PluggableAuthService.userFolderAddUser = postonly(userFolderAddUser)
PluggableAuthService.userFolderAddUser__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
 
    postonly(PluggableAuthService._doDelGroups)
PluggableAuthService.userFolderDelGroups__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
 

src/e/r/erp5-HEAD/product/ERP5Banking/Document/BankingOperation.py   erp5(Download)
from Products.ERP5.Document.Container import Container
from Products.ERP5.Document.AccountingTransaction import AccountingTransaction
from AccessControl.PermissionRole import PermissionRole
from Products.ERP5Type.Utils import convertToMixedCase, convertToUpperCase
from Products.ERP5Banking.BaobabMixin import BaobabMixin
### Dynamic patch
Delivery.getBaobabSourceUid = lambda x: x.getSourceUid()
Delivery.getBaobabSourceUid__roles__ = PermissionRole(Permissions.View)
 
Delivery.getBaobabDestinationUid = lambda x: x.getDestinationUid()
Delivery.getBaobabDestinationUid__roles__ = PermissionRole(Permissions.View)
 
Delivery.getBaobabSourceSectionUid = lambda x: x.getSourceSectionUid()
Delivery.getBaobabSourceSectionUid__roles__ = PermissionRole(Permissions.View)
 
Delivery.getBaobabDestinationSectionUid = lambda x: x.getDestinationSectionUid()
Delivery.getBaobabDestinationSectionUid__roles__ = PermissionRole(Permissions.View)
 
Delivery.getBaobabSourcePaymentUid = lambda x: x.getSourcePaymentUid()

src/p/r/Products.PloneHotfix20110720-1.2/Products/PloneHotfix20110720/__init__.py   Products.PloneHotfix20110720(Download)
from AccessControl.PermissionRole import PermissionRole
import Products.CMFPlone
 
import logging
logger = logging.getLogger('PloneHotfix20110720')
    methods = ()
 
    set_roles = PermissionRole('Manage portal', ('Manager',))
    kill_docstrings = False
 
    PatchTarget('Products.PluggableAuthService.PluggableAuthService.PluggableAuthService',
                methods='monkeys',
                set_roles=PermissionRole('Manage users', ('Manager',))),
    PatchTarget('Products.PortalTransforms.TransformEngine.TransformTool',
                methods=('convertTo', 'registerTransform', 'unregisterTransform')),
    PatchTarget('Products.PortalTransforms.Transform.Transform',
                methods=('convert',)),
    PatchTarget('Products.PlonePAS.plugins.user.UserManager',
                set_roles=PermissionRole('Manage users', ('Manager',))),
    PatchTarget('Products.PlonePAS.plugins.property.ZODBMutablePropertyProvider',
                methods=('deleteUser', 'enumerateUsers'),
                set_roles=PermissionRole('Manage users', ('Manager',))),
    PatchTarget('Products.CMFPlone.PropertiesTool.PropertiesTool',
                methods=('addPropertySheet',)),

src/a/t/atreal.monkeyplone-2.0.0/atreal/monkeyplone/__init__.py   atreal.monkeyplone(Download)
from AccessControl.PermissionRole import PermissionRole
from Products.Archetypes.BaseFolder import BaseFolderMixin
 
# manage_delObjects is called on parent so Permission View is sufficient
setattr(BaseFolderMixin, 'manage_delObjects__roles__', PermissionRole("View", ("Authenticated",)))
 
# manage_cutObjects is called on parent so Permission View is sufficient
setattr(BaseFolderMixin, 'manage_cutObjects__roles__', PermissionRole("View", ("Authenticated",)))
 
# manage_cutObjects is called on parent so Permission Add portal content is sufficient
setattr(BaseFolderMixin, 'manage_pasteObjects__roles__', PermissionRole("Add portal content", ("Contributor",)))
 
 

src/a/c/AccessControl-3.0.8/src/AccessControl/class_init.py   AccessControl(Download)
def InitializeClass(self):
    from AccessControl.Permission import registerPermissions
    from AccessControl.PermissionRole import PermissionRole
    dict=self.__dict__
    have=dict.has_key
            if len(acp) > 2:
                roles = acp[2]
                pr = PermissionRole(pname, roles)
            else:
                pr = PermissionRole(pname)

src/p/r/Products.PloneHotfix20121106-1.2/Products/PloneHotfix20121106/membership_tool.py   Products.PloneHotfix20121106(Download)
from AccessControl.PermissionRole import PermissionRole
from Products.CMFCore.permissions import ListPortalMembers
try:
    from Products.PlonePAS.tools.membership import MembershipTool
except ImportError:
    from Products.CMFPlone.MembershipTool import MembershipTool
MembershipTool.searchForMembers__roles__ = PermissionRole(ListPortalMembers, ('Manager',))

src/c/o/collective.deletepermission-1.1.3/collective/deletepermission/cut_object.py   collective.deletepermission(Download)
from AccessControl.Permissions import copy_or_move
from AccessControl import getSecurityManager
from Products.Archetypes.BaseFolder import BaseFolderMixin
from AccessControl.PermissionRole import PermissionRole
 
# AccessControl.class_init or App.class_init.
setattr(BaseFolderMixin, 'manage_cutObjects__roles__',
        PermissionRole("Delete objects", None))
 

src/z/o/Zope2-2.13.22/src/App/ProductContext.py   Zope2(Download)
 
from AccessControl.Permission import registerPermissions
from AccessControl.PermissionRole import PermissionRole
from App.Common import package_home
from App.ImageFile import ImageFile
            default = ('Manager',)
 
        pr = PermissionRole(permission,default)
        registerPermissions(((permission, (), default),))
        ############################################################

src/s/i/silva.core.conf-3.0.3/src/silva/core/conf/utils.py   silva.core.conf(Download)
# -*- coding: utf-8 -*-
# Copyright (c) 2002-2013 Infrae. All rights reserved.
# See also LICENSE.txt
 
from AccessControl.PermissionRole import PermissionRole
    default = ('Manager',)
    AccessControl.Permission.registerPermissions(((permission, (), default),))
    permission_setting = PermissionRole(permission, default)
    if not (isinstance(factory, tuple) or isinstance(factory, list)):
        factory = [factory,]

  1 | 2  Next