--- /cvs/drupal/contributions/modules/search_uploads/search_uploads.module	2008/02/14 05:26:26	1.2
+++ /cvs/drupal/contributions/modules/search_uploads/search_uploads.module	2008/07/16 14:24:39	1.2.2.1
@@ -1,6 +1,6 @@
 <?php
 
-// $Id: $
+// $Id: search_uploads.module,v 1.2 2008/02/14 05:26:26 pedrofaria Exp $
 
 function search_uploads_perm() {
   return array('search files');
@@ -21,6 +21,12 @@
       $rs = db_query("SELECT * FROM {files} WHERE filename LIKE '%%%s%%' OR filepath LIKE '%%%s%%'", $keys, $keys);
       while ($row = db_fetch_object($rs)) {
         $node = node_load(array('nid' => $row->nid));
+                
+        // checking if you have access to view node.
+        if (!node_access('view', $node)) {
+          continue;
+        }
+        
         $results[] = array(
             'link' => url($row->filepath),
             'type' => node_invoke($node, 'node_name'),

