Index: modules/imce/imce.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imce/imce.module,v
retrieving revision 1.8.2.24
diff -u -r1.8.2.24 imce.module
--- modules/imce/imce.module	29 Dec 2006 16:00:46 -0000	1.8.2.24
+++ modules/imce/imce.module	7 Jan 2007 23:04:39 -0000
@@ -25,7 +25,9 @@
  * Implementation of hook_perm().
  */
 function imce_perm() {
-  return array('access imce', 'administer imce');
+  $private = variable_get('file_downloads', '')==FILE_DOWNLOADS_PRIVATE;
+  $perms = array('access imce', 'administer imce');
+  return $private ? array_merge($perms, array('view imce files')) : $perms;
 }
 
 /**
@@ -739,7 +741,7 @@
   }
   if ($imcefile && ($path = file_create_path($file))) {
     $ctype = ($info = @getimagesize($path)) ? $info['mime'] : (function_exists('mime_content_type') ? mime_content_type($path) : 'application/x-download');
-    return array('Content-type: '. $ctype);
+    return user_access('view imce files') ? array('Content-type: '. $ctype) : -1;
   }
 }
 
