<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>The first thing I would try is to set your module's weight to -2 (assuming the node module is still 0) and see if the problem is resolved.<br></span></div><div>&nbsp;</div><div><font color="#ff007f" face="bookman old style, new york, times, serif" size="4"><i><strong>Nancy</strong></i></font></div>&nbsp;<div><font face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</font></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> toon severijns</font><div
 id="yiv1415070721"><br><div>I am using the <b>Workflow</b> module to handle state flow of a certain content type i'm using: <b>projects</b>. Depending on the particular workflow state and the role of the user, the user should be granted (or revoked) <b>edit access</b> to the node.</div>
<div><br></div><div>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.</div><div><br></div><div>I found out about the <b>Permissions API</b> module which gives me the ability to <b>grant or revoke permissions programmatically</b> based on role of the user and workflow state of the node. I call the permissions grant/revoke functions in&nbsp;<b>mymodule_preprocess_node_project </b>in <b>template.php</b>. This seems to work. The only issue i am having is the "edit"<b> local tasks menu item</b>. 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.</div>
<div><br></div><div>Any idea how i can solve this in a clean way?</div></div></div></div></blockquote></div></div></body></html>