Skip navigation
Help

comment_file_download_access

7 comment.module comment_file_download_access($field, $entity_type, $entity)

Implements hook_file_download_access().

File

drupal/modules/comment/comment.module, line 2689
Enables users to comment on published content.

Code

function comment_file_download_access($field, $entity_type, $entity) {
  if ($entity_type == 'comment') {
    if (user_access('access comments') && $entity->status == COMMENT_PUBLISHED || user_access('administer comments')) {
      $node = node_load($entity->nid);
      return node_access('view', $node);
    }
    return FALSE;
  }
}