Using Drupal Workflow Module to give permission on various role for content approval

drupal_workflow
Sometime we require a functionality in our client’s project as described below :

“Suppose A user can only create content . B User can move this content to ‘Review’ State . Then C user (as site admin) can finally approve this content. In this scenario A user should receive email whether content moved to approved or rejection”

I have created a tutorial on drupal to achieve this functionality.
Download and install some drupal module below:
Drupal workflow transitions

entity
rules
workflow
also recommended admin_menu if you have not installed already.

Step 1

After all above module installation, create a role ‘publisher’ from people->permission->roles

Step 2

Now Access Config->Workflow
Then create a work flow .Follow all the details in that form .Consider on “Workflow tab permissions” to check on our newly created role i.e ‘Publisher’ and ‘administrator’. Do not check on ‘(author)’. Because author can not manage workflow .

Step 3

We have to assign which of our content type should work with workflow.
So ,to achieve this access config->workflow
Then select workflow name for the required content type.

Step 4

Access “STATES” tab on the same above page and create some states as shown in below screenshot.

Drupal workflow states

Step 5

Now we are on main work to do i.e ‘TRANSITIONS’. You can access this page on the same page tab .Initially this page could be confusing to you . Let’s suppose in our context

Drupal workflow transitions

– author can move content from ‘creation’ to ‘DRAFT’ by default
So checked only on ‘author’ on 1st row

– Similarly ,publisher can move ‘Draft’ to ‘REVIEW’ .So checked on ‘Publisher’ on 2nd row
– Then administrator can move from ‘Review’ to ‘DRAFT’. So, checked on ‘administrator’ on 3rd row

Step 6

To send email to author on content approval or rejection ,we need to create 2 triggers .To do so, click on ‘Actions’ link on right side of the state name created on above page . Find proper event like
“Trigger: When node page moves from Review to Approved”
for content approved and
“Trigger: When node page moves from Review to Draft”
for content rejected

Step 7

Access peope->permission page and give permission as shown in screenshot
Drupal workflow permission

step 8

Access Config->Workflow ,There click on ‘access’ on the right side of the workflow name that we have created .Check properly access permission there.

Now all the major task has done, time to finalize the work.
Create 2 users .assign one of then to ‘Publisher’ role.

step 9

To check if it’s working , Open the site in another browser and log in as normal authenticated user .Then create a content.
Now log out and log in again with another user of ‘publisher’ role .
open the created page by authenticated users .If you have not shown just directly types in url ex: http://localhost/drupal/node/2
If everything ok in all above settings, you should see a tab ‘workflow’. Click on that.you see as shown below screenshot

Drupal workflow on site
Now open the same page on another browser where admin logged in , you should again find ‘workflow’ tab with settings to approve it .

If you have not succeeded ,recheck all of your settings. Best of Luck !

Online Web Development Training,Video Tutorials