Tutorial 6: Node lock
---Needs Fago's approval---
Overview
The following functionality implements a node locking functionality, kind of 'read-only' node, without any code – just by using existing modules.
We're going to add a link 'Lock'/ 'Un-Lock' to the desired content types, which users with the proper access rights can invoke.
Note: This depends on this patch to integrate ACL with workflow-ng.
Modules
* Workflow-ng - Enable: Workflow-ng UI, Workflow-ng, State Machine API, Configurable Content Links.
* ACL
* Content access
Setting Up
Setting Content Access
Through /content/types/story/access set the access rights as you wish, or follow figure 1. Note that 'admin' is a role we added manually through Roles.
Note that the content access is used not only for its fine functionality, but also because it takes care of the ACL rights for us.
Setting Configurable Content Links
Through /admin/build/cclinks 'Add a content link' (figure 2).
Setting Workflow-ng
We are going to add 3 configurations (which you will be able to import from here).
First one will make sure the user is inserted into the Lock ACL when he logs in. We're not dealing here with anonymous users, as we assume they aren't allowed to edit content.
Second and third configurations simply add/ remove the node from the Lock ACL.
That's it. you can test now the Lock node functionality. When you click node, the Edit tab should disappear and you won't be able to delete the node as well. When you will unlock the node, the previous Content Access rights are retrieved.
