function entity_file_download_access

7.x entity.module entity_file_download_access($field, $entity_type, $entity)

Implements hook_file_download_access() for entity types provided by the CRUD API.

File

entity/entity.module, line 1147
Module file for the entity API.

Code

function entity_file_download_access($field, $entity_type, $entity) {
  $info = entity_get_info($entity_type);
  if (in_array('EntityAPIControllerInterface', class_implements($info['controller class']))) {
    return entity_access('view', $entity_type, $entity);
  }
}