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

All Samples(83)  |  Call(37)  |  Derive(0)  |  Import(46)

            def _methodtest(callable):
        """Only allow callable when request method is %s.""" % methodsstr
        spec = inspect.getargspec(callable)
        args, defaults = spec[0], spec[3]
        try:
            r_index = args.index('REQUEST')
        except ValueError:
            raise ValueError('No REQUEST parameter in callable signature')
        
        arglen = len(args)
        if defaults is not None:
            defaults = zip(args[arglen - len(defaults):], defaults)
            arglen -= len(defaults)
            
        def _curried(*args, **kw):
            request = args[r_index]
            if IBrowserRequest.providedBy(request):
                if request.method not in methods:
                    raise Forbidden('Request must be %s' % methodsstr)
    
            # Reconstruct keyword arguments
            if defaults is not None:
                args, kwparams = args[:arglen], args[arglen:]
                for positional, (key, default) in zip(kwparams, defaults):
                    if positional is _default:
                        kw[key] = default
                    else:
                        kw[key] = positional
                        
            return callable(*args, **kw)
        
        # Build a facade, with a reference to our locally-scoped _curried
        name = callable.__name__
        facade_globs = dict(_curried=_curried, _default=_default)
        exec _buildFacade(name, spec, callable.__doc__) in facade_globs
        return facade_globs[name]
        


src/p/r/Products.PlonePAS-5.0/Products/PlonePAS/pas.py   Products.PlonePAS(Download)
from Products.PlonePAS.interfaces.group import IGroupIntrospection
from Products.PlonePAS.interfaces.plugins import IUserIntrospection
from AccessControl.requestmethod import postonly
 
# Register the PAS acl_users as a utility
 
PluggableAuthService.userFolderDelUsers = \
    postonly(PluggableAuthService._doDelUsers)
PluggableAuthService.userFolderDelUsers__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
PluggableAuthService.userFolderEditUser = \
    postonly(PluggableAuthService._doChangeUser)
PluggableAuthService.userFolderEditUser__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
        self.userSetGroups(login, groups)
 
PluggableAuthService.userFolderAddUser = postonly(userFolderAddUser)
PluggableAuthService.userFolderAddUser__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
PluggableAuthService.userFolderDelGroups = \
    postonly(PluggableAuthService._doDelGroups)
PluggableAuthService.userFolderDelGroups__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))

src/p/r/Products.PlonePAS-HEAD/Products/PlonePAS/pas.py   Products.PlonePAS(Download)
from Products.PlonePAS.interfaces.group import IGroupIntrospection
from Products.PlonePAS.interfaces.plugins import IUserIntrospection
from AccessControl.requestmethod import postonly
 
# Register the PAS acl_users as a utility
 
PluggableAuthService.userFolderDelUsers = \
    postonly(PluggableAuthService._doDelUsers)
PluggableAuthService.userFolderDelUsers__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
PluggableAuthService.userFolderEditUser = \
    postonly(PluggableAuthService._doChangeUser)
PluggableAuthService.userFolderEditUser__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
        self.userSetGroups(login, groups)
 
PluggableAuthService.userFolderAddUser = postonly(userFolderAddUser)
PluggableAuthService.userFolderAddUser__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))
 
PluggableAuthService.userFolderDelGroups = \
    postonly(PluggableAuthService._doDelGroups)
PluggableAuthService.userFolderDelGroups__roles__ = \
    PermissionRole(ManageUsers, ('Manager',))

src/p/r/Products.CMFPlacefulWorkflow-1.6.0/Products/CMFPlacefulWorkflow/DefaultWorkflowPolicy.py   Products.CMFPlacefulWorkflow(Download)
 
from AccessControl import ClassSecurityInfo
from AccessControl.requestmethod import postonly
from App.class_init import InitializeClass
from Acquisition import aq_base
        if REQUEST is not None:
            return self.manage_main(REQUEST, manage_tabs_message='Changed.')
    manage_changeWorkflows = postonly(manage_changeWorkflows)
 
    security.declareProtected(ManageWorkflowPolicies, 'setChainForPortalTypes')
        for portal_type in pt_names:
            self.setChain(portal_type, chain)
    setChainForPortalTypes = postonly(setChainForPortalTypes)
 
    security.declareProtected(ManageWorkflowPolicies, 'getChainFor')
 
        self._default_chain = tuple(ids)
    setDefaultChain = postonly(setDefaultChain)
 
    security.declareProtected(ManageWorkflowPolicies, 'getDefaultChain')
                        wf_id, repr(chain)))
            cbt[portal_type] = tuple(chain)
    setChain = postonly(setChain)
 
    security.declareProtected(ManageWorkflowPolicies, 'delChain')

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/PloneTool.py   Products.CMFPlone(Download)
from Products.CMFPlone.utils import safe_hasattr
from Products.statusmessages.interfaces import IStatusMessage
from AccessControl.requestmethod import postonly
from plone.app.linkintegrity.exceptions \
    import LinkIntegrityNotificationException
                if base_hasattr(obj, 'reindexObject'):
                    obj.reindexObject()
    changeOwnershipOf = postonly(changeOwnershipOf)
 
    security.declarePublic('urlparse')
        # Reindex the whole stuff.
        obj.reindexObjectSecurity()
    acquireLocalRoles = postonly(acquireLocalRoles)
 
    security.declarePublic('isLocalRoleAcquired')
        transaction_note('Deleted %s' % (', '.join(success)))
        return success, failure
    deleteObjectsByPaths = postonly(deleteObjectsByPaths)
 
    security.declarePublic('transitionObjectsByPaths')
                                              handle_errors)
        return failure
    transitionObjectsByPaths = postonly(transitionObjectsByPaths)
 
    security.declarePublic('renameObjectsByPaths')

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/PloneTool.py   Products.CMFPlone(Download)
from Products.CMFPlone.utils import safe_hasattr
from Products.statusmessages.interfaces import IStatusMessage
from AccessControl.requestmethod import postonly
from plone.app.linkintegrity.exceptions \
    import LinkIntegrityNotificationException
                if base_hasattr(obj, 'reindexObject'):
                    obj.reindexObject()
    changeOwnershipOf = postonly(changeOwnershipOf)
 
    security.declarePublic('urlparse')
        # Reindex the whole stuff.
        obj.reindexObjectSecurity()
    acquireLocalRoles = postonly(acquireLocalRoles)
 
    security.declarePublic('isLocalRoleAcquired')
        transaction_note('Deleted %s' % (', '.join(success)))
        return success, failure
    deleteObjectsByPaths = postonly(deleteObjectsByPaths)
 
    security.declarePublic('transitionObjectsByPaths')
                                              handle_errors)
        return failure
    transitionObjectsByPaths = postonly(transitionObjectsByPaths)
 
    security.declarePublic('renameObjectsByPaths')

src/p/r/Products.PlonePAS-5.0/Products/PlonePAS/tools/membership.py   Products.PlonePAS(Download)
from AccessControl import Unauthorized
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.requestmethod import postonly
from Acquisition import aq_get
from Acquisition import aq_inner
        else:
            raise BadRequest('Not logged in.')
    setPassword = postonly(setPassword)
 
    security.declareProtected(View, 'getCandidateLocalRoles')

src/p/r/Products.PlonePAS-5.0/Products/PlonePAS/plugins/role.py   Products.PlonePAS(Download)
 
from AccessControl import ClassSecurityInfo
from AccessControl.requestmethod import postonly
from Acquisition import aq_parent, aq_inner, aq_get
from App.class_init import InitializeClass
        self._principal_roles[principal_id] = tuple(roles)
 
    assignRolesToPrincipal = postonly(assignRolesToPrincipal)
 
    security.declarePrivate('getRolesForPrincipal')

src/p/r/Products.PlonePAS-HEAD/Products/PlonePAS/tools/membership.py   Products.PlonePAS(Download)
from AccessControl import Unauthorized
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.requestmethod import postonly
from Acquisition import aq_get
from Acquisition import aq_inner
        else:
            raise BadRequest('Not logged in.')
    setPassword = postonly(setPassword)
 
    security.declareProtected(View, 'getCandidateLocalRoles')

src/p/r/Products.PlonePAS-HEAD/Products/PlonePAS/plugins/role.py   Products.PlonePAS(Download)
 
from AccessControl import ClassSecurityInfo
from AccessControl.requestmethod import postonly
from Acquisition import aq_parent, aq_inner, aq_get
from App.class_init import InitializeClass
        self._principal_roles[principal_id] = tuple(roles)
 
    assignRolesToPrincipal = postonly(assignRolesToPrincipal)
 
    security.declarePrivate('getRolesForPrincipal')

src/p/r/Products.CMFPlacefulWorkflow-1.6.0/Products/CMFPlacefulWorkflow/PlacefulWorkflowTool.py   Products.CMFPlacefulWorkflow(Download)
from os.path import join as path_join
 
from AccessControl.requestmethod import postonly
from AccessControl import ClassSecurityInfo
from AccessControl import Unauthorized
            RESPONSE.redirect(self.absolute_url() +
                              '/manage_main?management_view=Contents')
    manage_addWorkflowPolicy = postonly(manage_addWorkflowPolicy)
 
    def all_meta_types(self):

  1 | 2 | 3 | 4 | 5  Next