Access node fields in hook_node_grants In hook_node_grants() I want to check if user ID is equal to a node's field value, But there is only two arguments: $account and $op

How can I access the node object that is being checked for grants?
A better approach to this would be to implement hook_node_api that checks the current $user's permissions to the loaded field then does something.

function custom_module_nodeapi(&amp;$node, $op, $a3 = NULL, $a4 = NULL) {
  //get the current user
  global $user;

  switch ($op) {
    case 'load':
      //do some logic with $node and with the current $user's roles
    break;

    //(optional)add other cases for other operations

    default:
    break;
  }
}


alternatively you can try template_preprocess_node

function theme_name_preprocess_node(&amp;$variables) {
  global $user;
  $node = $variables['node'];

  //do some stuff with $node and $user
}