Stop node being edited programatically
For this you should have to implement hook_node_grants and hook_node_access_records. It look something like that -

 /**
  * Implement @hook_node_grants 
  */
 function MODULENAME_node_grants($account, $op) {

  $grants =array();
  $grants['Node_Edit_Permission'][]=array($account-&gt;uid);
 return $grants;
}

/**
 * Implement @hook_node_access_records
 */
function MODULENAME_node_access_records($node) {

  $grants = array();

  if ($node-&gt;type == 'node_type') { 
    $user_id = /* list of user id which you want to block */;

     // Revoke Permissions from these Users
    if (!empty($user_id) {
      foreach ($user_id as $uid) {
        if (isset($uid)) {

          $grants[] = array(
            'realm' =&gt; 'Node_Edit_Permission',
            'gid' =&gt; $uid,
            'grant_view' =&gt; 1,
            'grant_update' =&gt; 0,
            'grant_delete' =&gt; 0,
            'priority' =&gt; 0,
          );
        }
      }
    }
  }

  return $grants;
}