Exemple #1
0
    setChain = postonly(setChain)

    security.declareProtected(ManageWorkflowPolicies, 'delChain')

    def delChain(self, portal_type, REQUEST=None):
        """Delete the chain for a portal type."""
        if portal_type in self._chains_by_type:
            del self._chains_by_type[portal_type]

    delChain = postonly(delChain)

    #
    #   Helper methods
    #
    security.declarePrivate('_listTypeInfo')

    def _listTypeInfo(self):
        """ List the portal types which are available.
        """
        pt = getToolByName(self, 'portal_types', None)
        if pt is None:
            return ()
        else:
            return pt.listTypeInfo()


InitializeClass(DefaultWorkflowPolicyDefinition)

addWorkflowPolicyFactory(DefaultWorkflowPolicyDefinition,
                         title='Simple Policy')
Exemple #2
0
                    raise ValueError, ("'%s' is not a workflow ID." % wf_id)
            cbt[portal_type] = tuple(chain)
    setChain = postonly(setChain)

    security.declareProtected( ManagePortal, 'delChain')
    def delChain(self, portal_type, REQUEST=None):
        """Delete the chain for a portal type."""
        if self._chains_by_type.has_key(portal_type):
            del self._chains_by_type[portal_type]
    delChain = postonly(delChain)

    #
    #   Helper methods
    #
    security.declarePrivate( '_listTypeInfo' )
    def _listTypeInfo(self):

        """ List the portal types which are available.
        """
        pt = getToolByName(self, 'portal_types', None)
        if pt is None:
            return ()
        else:
            return pt.listTypeInfo()


InitializeClass(DefaultWorkflowPolicyDefinition)

addWorkflowPolicyFactory(DefaultWorkflowPolicyDefinition, title='Simple Policy')

            #
            # * Not defined in the cbt, and has been marked: _MARKER
            #
            # * Undefined, because there is no cbt: None
            #
            # * Defined as the default chain in the cbt: (DEFAULT_CHAIN,)
            #
            # In all these cases, use the default chain
            if managescreen:
                # In the ZMI management screen show "(Default)"
                chain = DEFAULT_CHAIN
            else:
                # Return the default chain tuple 
                chain = self.getDefaultChain(obj)            

        return chain

    security.declareProtected( ManagePortal, 'getDefaultChain')
    def getDefaultChain(self, obj):
        """ Returns the default chain."""
        # A default chain must be available, otherwise we can't control 
        # access to GroupSpace content.
        assert(not self._default_chain is None)        
        return self._default_chain

InitializeClass(GroupSpaceWorkflowPolicyDefinition)

addWorkflowPolicyFactory(GroupSpaceWorkflowPolicyDefinition, 
                         title='GroupSpace Policy')