Jump to:
| Project: | Workflow |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | support request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
I created a simple publishing workflow with 3 states (draft, revision, aproved).
I assigned the workflow to content_type A which is a clone of page.
The creator role has the standar drupal "create" permission for content type A.
The editor role has the standar drupal "edit any A content" and "delete any A content" permissions.
In workflow_acces I assgined the creator role the "view" and "edit" access to posts in state "draft".
Users with role creator can create content. When the content is saved it enters in state draft.
The problem is that the users with role creator can't edit or delete the content in the state draft.
If I add the "edit any A content" to the creator role they can do it but in all states (because of Drupals whitelist approach). I want to grant this permission only in the draft state.
I tried to recreate the node_access table with http://example.com/?q=admin/content/node-settings but nothing changed.
Actually looking at node_access table it seems correct:
nid: 25 (of type A in state Draft)
gid: 4 (group creator)
realm: workflow_access
grant_view: 1
grant_update: 1
grant_delete: 1
Am I doing anything wrong or is there possibly a problem with the workflow_access modul?
Many thanks,
Manfred
Comments
#1
I really would appretiate any help on this issue.
As the entry in the node_access table seems to be correct I'm not even sure if the problem is caused by the workflow module or if there is something else I missed?
Thanks,
Manfred
#2
Ok, I think I just found the solution:
My problem was that the content was created as not published ($node->status=0).
Looking at the node_access() function in modules/node/node_module I found in line 2019:
if ($op != 'create' && $node->nid && $node->status) {which means that the node_access table is only used for published nodes.
Then in line 2037-2034 (executed in case of unpublished node)
// Let authors view their own nodes.if ($op == 'view' && $account->uid == $node->uid && $account->uid != 0) {
return TRUE;
}
which means that authors can only view there own nodes but not edit or delete them if they are not published.
Solution:
Configure the node_type as published by default and workflow_access will control as expected user access.
#3
If you're not worried about the fact that authors have to create their first drafts in a published state, then ignore this message.
If you are... then have a look at this module: Revisioning.
#4
And perhaps this one:
http://drupal.org/project/module_grants
#5
Based on the offered solutions, and that it's been over a year since you posted on this - I'm going to assume they helped you out and go ahead and close this ticket. If not, then get updated to the latest version of the module and check if the problem is still there. If so, then open a new ticket and I'll be glad to look at it.