Index: filefield.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filefield/filefield.module,v
retrieving revision 1.162
diff -u -p -r1.162 filefield.module
--- filefield.module    4 Feb 2009 03:04:25 -0000       1.162
+++ filefield.module    17 Jun 2009 14:37:34 -0000
@@ -158,6 +158,7 @@ function filefield_file_download($file) 
   // better way at the moment. Input appreciated.
   // (And yeah, node access checks also include checking for 'access content'.)
   $nodes = array();
+  $denied = array();
   foreach ($cck_files as $field_name => $field_files) {
     foreach ($field_files as $revision_id => $content) {
       // Checking separately for each revision is probably not the best idea -
@@ -169,10 +170,13 @@ function filefield_file_download($file) 
       $node = node_load($content['nid']);
       if (!node_access('view', $node)) {
         // You don't have permission to view the node this file is attached to.
-        return -1;
+        $denied[] = TRUE;
       }
       $nodes[$content['nid']] = $node;
     }
+    if ($denied && count($denied) == count($nodes)) {
+      return -1;
+    }
   }

   // Well I guess you can see this file.

