Create a multi-step moderation process in Drupal 6

This will guide you through creating a multi-step process of content moderation in Drupal 6. This is a follow on to the guide on Drupal.org about creating a revisioning system and the follow on, on creating a revisioning system with state-based access. Both of which only allow a single step revisioning sytem, i.e. Author creates content, moderator either edits and publishes or sends back to author to edit.

Scenario

A user submits a piece of content, we will refer to this user as the author. The content is not published and is sent to another user for moderation, we will refer to this user as the moderator.

The moderator can then either set the content from a moderation state back to a draft state for the author to amend or through to a "to be published state".

Once the moderator has checked the content and made amends they can mark the content as ready for publishing. At which point a third user which we will refer to as the publisher, can make further amends to the content and publish it, make further amends and send back to the moderator to check through the changes or mark the content as back to draft to allow the author to change it.

Required modules

A few contributed modules are required to get this process in place as well as a couple of core modules.

The Diff module is optional, but can be useful to easily see what parts of the content have changed from each revision.

Enable modules

Some of the modules have sub-modules which come with the main module, so be sure to check all the required modules, which are:

  • Module Grants
  • Module Grants Monitor (Optional)
  • Node Tools
  • User Tools
  • Profile
  • Trigger (Optional)
  • Smart tabs
  • Diff (Optional)
  • Revisioning
  • Token
  • Token actions
  • Workflow
  • Workflow access

If you already have content on your site, you will also need to download and install Workflow Post Install, otherwise all old content may only be accessible by administrator.

Create user roles

You can have as many different roles to allow more fine grained control over who can create what content types, but to try and keep this tutorial as simple as possible, I will stick to the three main roles defined in the scenario.

  • Author
  • Moderator
  • Publisher

It may be best to give your author role a different role name as the Workflow module automatically adds a line in the admin for "author" which applies to any role creating content.

Go to Administer > User management > Roles (admin/user/roles).

Then add your three roles, I will be using author role, moderator role and publisher role.

Set up workflow settings

Go to Administer > Site building > Workflow (admin/build/workflow).

Create a new Workflow and call it Moderation.

In the State name box, enter in draft and set the weight to -10. Save the state.

Once the state has saved, click the List tab and click the Add state link.

Add the following states:

  • in moderation (weight: -2)
  • is moderated (weight: 2)
  • live (weight: 10)

Underneath your states, you can apply the workflow to separate content types. I will be applying it to both the default content types (Page and Story).

Next to the Moderation workflow, click the Edit link.

This page may seem a little daunting at first, but don't panic. The first set of checkboxes allow you to set out which roles can transition the node between certain states. You will also see the extra "author" role that I refered to earlier.

The first row is for the original creation of the node. This is the transition from the (creation) state to the in draft state. The only role we are giving access to this is the Workflow defined author, note that this is not the author role that we created.


Click for larger version

The next transition is from being in draft to in moderation. For this transition, we want to set this to our author role as opposed to the workflow defined author.


Click for larger version

The next transition is from in moderation to is moderated. This is our moderation step where the content is moderated prior to being sent back to the author for further amends or to the publisher for final approval and publishing. We want to set the moderator role under in draft and is moderated.


Click for larger version

Next is the step from being moderated to going to the publisher. There are some optional transitions that you can put in here, depending on how you want to work. The one that everyone would need is the transition from is moderated to live. The one that will differ is for rejections. Some people will want it to go back to draft, whereas others will want it to go back to moderator, others will want both options. This way if there isn't a major problem, the content can be sent back to the moderator for further moderation rather than having to go back to the author only to be sent back to the moderator.


Click for larger version

The final transition is from the live state. The only role that needs this is our author role (not the workflow author role) to be able to take the content back to in draft. This will not change the live copy, but create an unpublished revision which we will set up in the next part of the tutorial.


Click for larger version

After the checkboxes, in the Comment for Workflow Log section, make sure both boxes are ticked to show a comment form in the Workflow and node edit screens to allow the roles to add their comments for the next role to read to understand why the amends were rejected or what was changed.

In the Workflow tab permissions, check our three roles.

Next we have the Access control section. These permissions allow you to set permissions to certain roles based on the state of the content (in draft, in moderation, is moderated, live). Take in to account that these permissions will be overridden by some of the permissions in the User management > Permissions page which we will get on to later.

In the sections for each state, the anonymous user and authenticated user should stay ticked under Roles who can view posts in this state.

Under in draft, check our author role for Roles who can edit posts in this state.


Click for larger version

Under in moderation, check our moderator role for Roles who can edit posts in this state.


Click for larger version

Under is moderated, check our publisher role for Roles who can edit posts in this state.

Click for larger version

Leave the live state with only the default view options checked.

Press Save.

Configure content types

Go to Administer > Content management > Content types (admin/content/types).

Click the Edit link next to the content type you wish you apply the moderation workflow.

Under the Workflow settings, uncheck the Published box as we don't want to publish the content until it has been moderated and approved.

Check both the Create new revision and New revision in draft, pending moderation (requires "Create new revision") boxes to create a revision for each modification of the content.

Under Create new revision, it is up to you what setting you use, but remember to read the description text below the options.


Click here for larger version

If you have the Diff module enabled, you will get the additional option Show Preview changes button on node edit form which will allow you to see the difference between the current edits and the current revision.

Repeat this step for all content types that you wish to have moderation enabled for.

Set up user permissions

Go to Administer > User management > Permissions (admin/user/permissions).

Under the module_grants_monitor module section. Tick the boxes access All tab, access I Can Edit tab and access I Can View tab for the moderator role. For the publisher role, you can tick the same boxes plus access Published tab and access Unpublished tab.


Click for larger version

Under node module, make sure anonymous user and authenticated user are both checked for access content.

For author role, tick the boxes to allow them to create content of selected content types as well as being able to edit their own content.

For the moderator and publisher roles, allow them to edit any content as well as view or revert any revisions, but if you want further control over this, you can set this later on in the revisioning section.


Click for larger version

Under revisioning module, give the author role the ability to view revision status messages and to edit revisions of their own content. Moderators should have permission to access Pending tab, edit revisions and view revision status messages. The publisher role should have the same permissions as the moderator role, but should also have unpublish current revision and publish revisions.


Click for larger version

Press Save.

Set up email triggers

For information on setting up and using Triggers and Actions in Drupal 6, it is best to read the excellent page on the Drupal.org website at http://drupal.org/node/199254

Comments

Thank you,

This guide is very useful for sites needing serious moderation and editorial quality assurance.

Interesting article, full of screeshots and instructions! Thanks for writing it!

Back in May I made a presentation on the exact same topic at the Geneva Drupal Meetup. The slides (in English) can be viewed at http://webmail.linalis.com/home/mdupont@linalis.com/Briefcase/Public/Wor...

Don't forget to edit admin/settings/revisioning to check "editing the latest revision" to prevent multiple pending revisions.

I need to assign separate pages to separate users.

For example,

"Hiring Process" page can be edited by author in HR department and can only be moderated by a moderator in HR department.. further it needs an additional permission from Customer Relations to get it live on website.

any idea how to manage this department thing? means assign specific nodes (may be by node id) to specific users (or roles) ..

The best way I can think of is to create different roles based on departments. So within your HR department, you would have HR Author, HR Moderator then in a different department you could have Custom Support Author, Customer Support Moderator. But obviously with a lot of departments this could get quite complex on the backend. To make it a bit simpler you could create a different workflow per department.

It may be worth reading through Revisioning for categorized content which should cater for multiple departments and may be a better way for you to approach the problem.

Hello, I have the same need. Different departments will have different moderators and authors, but they will be groups of people. Can the roles be assigned to users?
Thnx.

hi,

how to I adjust the permissions to allow Authors to edit their current drafts?
when I click on the REVISIONS tab and select the draft I just created I don't have the option to EDIT.
I can only edit the current version that's already published.
I did change the workflow state to "In Draft".. not really sure what that does other than create a Revision.. which I can't edit. (as an author role)

thxs

Within the workflow, if you check author for being able to edit in draft, you may get what you want.

We no longer use this on our work site as we decided to scrap all access modules to simplify permissions.

If some one can make a single module with all the ingredient modules, it would have been easier to configure.

Thanks for sharing helpful hands on

I must say, well explained article, thank you for putting time in organising this article.

Regards
Raghunath