Hide the content while the current user has no access on I written a module to filter the access for country_admin,country_admin can only view and edit the content that have the same country with the country_admin.(Both the country_admin and content have a country field.)
Now I want to hide the content that current country_admin have no access on. Is there a function can hide the content in drupal 7 ? 
Will be very appreciate if anyone can help.

if(!isset($target_user-&gt;field_role_country) || !$target_user-&gt;field_role_country['und'][0]['value']) {
  // The value is false (checkbox not checked) so we refuse access:
  return FALSE;
}
elseif ($node-&gt;type == 'clinic' 
    &amp;&amp; strtolower($target_user-&gt;field_role_country['und'][0]['value']) != strtolower($node-&gt;field_country['und'][0]['value'])) {
  drupal_set_message('This clinic does not associated with :country, You have no permission to view.', array(':country' =&gt; $target_user-&gt;field_role_country['und'][0]['value']));
  return FALSE;
}
hook_query_alter() serves this purpose.

The exact query alter you want looks like this:

function modulename_query_node_access_alter(QueryAlterableInterface $query) {
  // Obtain node, if needed
  $node = $query-&gt;getMetaData('node');

  // Do some calculations

  // Add condition
  $query-&gt;condition( /* your custom conditions here */ );
}


More details on Query alteration documentation page.