Access node fields in hook_node_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
}