Check if user can edit node with certain ID
You can use node_access to do this:

$node = node_load(123);
$account = user_load(456);

if (node_access("update", $node, $account) === TRUE) {
  do_something_awesome();
}


If you look at the source for node_access, you will see that the $node argument can also be a $nid.  This is how the path for the edit pages get checked (see the 'node/%node/edit' entry in node_menu).