[support] Set per user/per role edit permission based on workflow state?

toon severijns toon.severijns at gmail.com
Thu Jun 23 09:13:52 UTC 2011


Hello All,

I am using the *Workflow* module to handle state flow of a certain content
type i'm using: *projects*. Depending on the particular workflow state and
the role of the user, the user should be granted (or revoked) *edit
access*to the node.

I passed on the option to use Rules as this is more for reactions on events,
whereas i would need a general check on node workflow state to decide on
user edit access.

I found out about the *Permissions API* module which gives me the ability to
*grant or revoke permissions programmatically* based on role of the user and
workflow state of the node. I call the permissions grant/revoke functions
in *mymodule_preprocess_node_project *in *template.php*. This seems to work.
The only issue i am having is the "edit"* local tasks menu item*. This only
seems to be set on the second page load. In other words, the local tasks
menu seems to be built before my permissions API functions have taken effect
on first page load.

Any idea how i can solve this in a clean way?

Best,



Toon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110623/e933d86c/attachment.html 


More information about the support mailing list