kotti/workflow.zcml

Summary

Maintainability
Test Coverage
<configure xmlns="http://namespaces.repoze.org/bfg" xmlns:i18n="http://xml.zope.org/namespaces/i18n"
           i18n:domain="Kotti">

  <!-- Kotti's default workflow file.

  To use, set 'kotti.use_workflow = kotti:workflow.zcml' (which is the default).

  If your site already has content and you configure it use a workflow for the
  first time, or you use a different workflow than the one you used before, run
  the 'kotti-reset-workflow' command to reset all your content's workflow.
  -->

  <include package="repoze.workflow" file="meta.zcml"/>

  <workflow name="simple" initial_state="private"
            type="security" state_attr="state"
            content_types="kotti.interfaces.IDefaultWorkflow"
            permission_checker="kotti.security.has_permission">

    <state name="private" title="Private" i18n:attributes="title"
           callback="kotti.workflow.workflow_callback">
      <key name="order" value="1" />
      <key name="inherit" value="0" />
      <key name="system.Everyone" value="" />
      <key name="role:viewer" value="view" />
      <key name="role:editor" value="view add edit delete state_change" />
      <key name="role:owner" value="view add edit delete manage state_change" />
    </state>

    <state name="public" title="Public" i18n:attributes="title"
           callback="kotti.workflow.workflow_callback">
      <key name="order" value="2" />
      <key name="inherit" value="0" />
      <key name="system.Everyone" value="view" />
      <key name="role:viewer" value="view" />
      <key name="role:editor" value="view add edit delete state_change" />
      <key name="role:owner" value="view add edit delete manage state_change" />
    </state>

    <transition name="private_to_public" permission="state_change"
                from_state="private" to_state="public"
                title="publish" i18n:attributes="title">
    </transition>

    <transition name="public_to_private" permission="state_change"
                from_state="public" to_state="private"
                title="unpublish" i18n:attributes="title">
    </transition>

  </workflow>
</configure>