[Zope-CMF] Making read-only content

Tres Seaver tseaver@palladion.com
Thu, 4 Oct 2001 22:00:10 -0400 (EDT)


On Fri, 5 Oct 2001, Simon Coles wrote:

> Hi,
> 
> We have a CMF-based product (OS-ELN, http://www.opensourceeln.org).
> 
> The user can create content ("Experiments") the normal way through the web 
> and edit existing experiments etc. just fine.
> 
> They can also create experiments by importing an XML file. In this case, we 
> would like those experiments and their component files to be read only so 
> no one (including the owner) can modify them.
> 
> Is there a clean way of doing this in the CMF?

Yes.  Define a custom workflow for your "Experiment" type (e.g., start
from the "classic" DCWorkflow sample).  Add a state, "Locked", and a
transition, "lock", to your workflow, and have your XML parsing routine
invoke that transition.  Set the permissions on the "Locked" state such
that nobody (or just Manager?) has "Modify portal content", and make sure
that there are no transitions out of that state.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com