Arguments of hook_file_download_access_alter() function hook_file_download_access_alter(&amp;$grants, $field, $entity_type, $entity) {
  // For our example module, we always enforce the rules set by node module.
  if (isset($grants['node'])) {
    $grants = array('node' =&gt; $grants['node']);
  }
}


The arguments $field, $entity_type, $entity are not used in the  implementation. What are these arguments used for, when the function is called?
You do not need to use $field, $entity_type and $entity in your implementation of hook_file_download_access_alter(), if you do not want to.

You should use theses arguments if you need to handle files differently depending on which field of which entity they belong to.

For example, node_file_download_access() restricts access on files to people that can view the node. If you want to remove this restriction for nodes of a specific type foo, you would have to check whether $entity_type == 'node'and whether $entity-&gt;type == 'foo' and grant access if this is the case.