I'm using Display Suite custom fields to have the edit link rendered somewhere else on the node page. Is there an easy way to verify the currently logged-in user has the permission to edit the node?.
So far I tried this code.
global $user;
if (node_access('update', $nid, $user)) {
echo l(t('Edit this node'), 'node/' . $node->nid . '/edit');
}
What code should I instead use?