How to print edit link on a node page if the current logged-in user has access to node edit I'm using Display Suite custom fields to have my Edit link rendered somewhere else on the node page, I'd like to see if there's an easy way to check if the current user has the permission to edit the node or not.

So far I tried this:

&lt;?php 
global $user;
      if (node_access('update', $nid, $user) == true) {
       echo l(t('Edit this node'), 'node/' . $node-&gt;nid . '/edit');
      }
?&gt;


unfortunately does not work, Thanks a million.
First of all you need to make sure to get access to your administrators as well as the author, also note that you need to load nid along with the uid

&lt;?php 
global $user;
$node = node_load(arg(1));
if(user_access('edit any "" content') || ($user-&gt;uid == $node-&gt;uid)){
    echo l(t('Edit this node'), 'node/' . $node-&gt;nid . '/edit');
}
?&gt;