How to grant permission to a node for an user programatically? I am using ACL module to set user wise permission . Its working fine and I am able to set permission user wise from admin access.

What I need:

I have the nid and uid and I wants to set node view access permission to that user programmatically.
You may want to program it yourself, you can have something like this, probably implementing hook_init():

function my_module_init() {
  global $user;

  $nid = 85; // We'll check node 85.

  // Users with access:
  $uids = array(
    3,
    9,
    11,
  );

  $node_path = 'node/' . $nid;

  // Check if the user is in the node detail.
  if (current_path() == $node_path) {
    // Check if the user is not in the list of allowed users.
    if (!in_array($user-&gt;uid, $uids)) {
      drupal_access_denied();
    }
  }
}