diff --git a/filefield.module b/filefield.module index ee28bc1a13f3740ccbd6bef0031006184fd71e74..d90fa7132a180216e6ad1e8b506f80fb975e60e4 100644 --- a/filefield.module +++ b/filefield.module @@ -188,7 +188,7 @@ function filefield_file_download($filepath) { if (isset($nodes[$content['nid']])) { continue; // Don't check the same node twice. } - if (($node = node_load($content['nid'])) && (node_access('view', $node) && filefield_view_access($field_name))) { + if (($node = node_load($content['nid'])) && (node_access('view', $node) && filefield_view_access($field_name, $node))) { $denied = FALSE; break 2; } @@ -514,8 +514,8 @@ function filefield_edit_access($type_name, $field_name) { /** * Access callback that checks if the current user may view the filefield. */ -function filefield_view_access($field_name) { - if (!content_access('view', content_fields($field_name))) { +function filefield_view_access($field_name, $node = NULL) { + if (!content_access('view', content_fields($field_name), NULL, $node)) { return FALSE; } // No content permissions to check, so let's fall back to a more general permission.