imce.module does not provide an access permission to restrict file download by role.

By way of contrast, upload.module provides "view uploaded files" which in combination with the private file system will restrict access to uploaded files by role.

However, once imce is enabled - all requests for private files will always be provided by drupal. This defeats the idea of a private file system.

I request addition of a "view uploaded files" permission to the imce module, and patch to imce_file_download to return -1 if user_access('view uploaded file') fails.

Thanks

David

CommentFileSizeAuthor
#2 imce.module.patch1.08 KBufku

Comments

drpratten’s picture

The core team may fix this bug once for the whole of Drupal. See http://drupal.org/node/106565

ufku’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

A private files permission specific to IMCE is a good idea. The attached patch proposes usage of a new "view imce files" permission.

Lowell’s picture

does this patch work?
is this something I can install now?

this might be exactly what I am looking for

ufku’s picture

this is outdated. there are only a few changes to be done to get the mentioned functionality. you may update the patch for the current release and use it.

Leeteq’s picture

Status: Needs review » Postponed (maintainer needs more info)

Is this still an issue in the latest release? (Should this one be closed?)

MiMe’s picture

This is still an issue even for the Drupal 6 version of IMCE! Guests can access "private" (off site) files even though they don't have any permission to the directory.

MiMe’s picture

Actually pretty easy to check in Drupal 6, in the function imce_file_download($file) you have to check if the current user have access to the file being viewed!

MiMe’s picture

Those of you that are looking for a Drupal 6 fix: #266549: directory protection from leeching

ufku’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)