Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install collective.subtractiveworkflow

How to install collective.subtractiveworkflow

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.subtractiveworkflow
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
2.0b1 Available View build log
1.0b1 Available View build log
Windows (64-bit)
2.0b1 Available View build log
1.0b1 Available View build log
Mac OS X (10.5+)
2.0b1 Available View build log
1.0b1 Available View build log
Linux (32-bit)
2.0b1 Available View build log
1.0b1 Available View build log
Linux (64-bit)
2.0b1 Available View build log
1.0b1 Available View build log
 
Author
License
BSD
Depended by
Lastest release
version 2.0b1 on Jan 5th, 2011

System Message: ERROR/3 (<string>, line 1)

Content block expected for the "ATTENTION" directive; none found.

.. ATTENTION::

System Message: WARNING/2 (<string>, line 2)

Explicit markup ends without a blank line; unexpected unindent.

This version works only on Plone 4 (Products.CMFCore 2.2, Products.DCWorkflow 2.2). If you want to use this package on Plone 3.3, please use the 1.0b1 version.

Introduction

This product provides an alternative type of workflow definition. It works much like a regular workflow, but instead of granting permissions when entering a particular state, it takes them away from the selected roles.

The original use case was to support "confidential" content items via a secondary workflow. The primary chain on the type has a publishing workflow that will grant the View permission to various roles in various states. The secondary 'confidentiality workflow' has two states: 'normal' and 'confidential'. In the 'normal' state, no roles are selected for the View permission, and so the role mappings from the primary workflow apply. However, in the 'confidential' state, Anonymous, Authenticated and Member have been selected for the View permission and so these roles no longer have the ability to view the item.

Note that the 'acquire' flag should almost always be off. The subtractive workflow will set the acquire property in the same way as the default workflow definition, but the results will probably not be what you expect, since permissions that were "turned off" may well be acquired.

Also note that group-to-local role mappings are not "subtractive" and work exactly as in the standard workflow definition. In general, local roles are always inherited in Zope (although Plone has an extension to turn this off).

The effects of multiple workflows

This product depends on an interpretation of the DCWorkflow permissions system as follows:

  • If there are multiple workflows in a chain, the item's state is determined

System Message: WARNING/2 (<string>, line 39)

Bullet list ends without a blank line; unexpected unindent.

by all the workflows, not just the last one.

  • In particular, the permission settings in all workflows in the chain apply

System Message: WARNING/2 (<string>, line 42)

Bullet list ends without a blank line; unexpected unindent.

at all times. Later workflows can override earlier ones.

To support this, an event handler is installed that will, when a transition occurs, "re-play" the updateRoleMappings() call for all workflows in the chain (there is an optimisation to avoid duplicate work if there's only one workflow in the chain). It will do nothing if there are no subtractive workflows in the chain, but as soon as there is one, you will get this behaviour.

Thus, if you have a subtractive workflow as the second workflow in a two-workflow chain, and you invoke a transition from either the first or the second workflow, the permissions from both will apply, with the subtractive workflow allowed to override the normal workflow.

Note that this may affect existing multi-workflow chains, because by default, DCWorkflow does not "re-play" the role mappings in this way, letting instead the most recently entered state determine the role mappings and fully overriding roles from the current state of any other workflows in the chain.

Changelog

2.0b1 (2010-09-11)
  • The fact of setting dummy to the container generate an AddedObjectEvent,

System Message: WARNING/2 (<string>, line 68)

Bullet list ends without a blank line; unexpected unindent.

Products.CMFCore.CMFCatalogAware.handleContentishEvent catch the event and call wftool.notifyCreated(dummy). Products.CMFCore 2.2, in Products.CMFCore.WorkflowTool.notifyCreated, added a check, wf.notifyCreated is not called if it was previously called (workflow_history not empty). So in the tests, wftool.notifyCreated(dummy) does nothing after the dummy object has been set to the container. All the tests have been adapted and fixed. [vincentfretin]

  • Removed the explicit check "event.transition is None, then return" in

System Message: WARNING/2 (<string>, line 76)

Bullet list ends without a blank line; unexpected unindent.

react.object_transitioned subscriber. We want the roles mapping to be updated if the confidential state is the initial state. [vincentfretin]

  • Fixed workflow GenericSetup import, the _initDCWorkflow signature changed

System Message: WARNING/2 (<string>, line 82)

Bullet list ends without a blank line; unexpected unindent.

in Products.DCWorkflow 2.2 used by Plone 4. This version will not work anymore with Products.DCWorkflow 2.1 used by Plone 3. [vincentfretin]

1.0b1 - 2009-04-03
  • Initial release

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.