Granting access based on an entity reference field using rules I have two content type one called audit and one called non-conformance, a non conformance is raised after an audit has been complete.

An audit contains an entity reference field called auditee which references a user, I would like to give edit access to the non conformance based on the the content of the auditee field in on the content type audit.

Thanks
This should do the trick for you. You only have to write the code for extract_uid_from_audit(); if you don't know how we can help as well.

function mymodule_node_access($node, $op, $account) {
    if(!empty($node-&gt;type) &amp;&amp; ($node-&gt;type == "non_conformance")
             &amp;&amp; $op=='update') ){
        $uid = extract_uid_from_audit($node);
        if($uid = $account-&gt;uid)
             return NODE_ACCESS_ALLOW;
    }
}