user cannot edit the page
Use this code may be it helpful 

if ($query == $user-&gt;uid &amp;&amp; arg(0) == 'node' &amp;&amp; is_numeric(arg(1)) &amp;&amp; arg(2)== 'edit' ){

$query_path= db_query("select n.nid from {node} n
where n.nid =$nid")-&gt;FetchField();
 drupal_goto('node/'.$query_path);
}


place uid with your role id