IMCE Private Files
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
IMCE (https://drupal.org/project/imce), which provides a file uploader and
browser that can be used alone or within a WYSIWYG editor, is one of Drupal's most popular contributed modules. This module extends IMCE by providing additional integration with Drupal's private file system. You can use it in one of two modes:
- Simple Mode: All users with a specific role (defaults to "Authorized User") attempting to download an IMCE file via an inline link rather than the IMCE browser will be allowed to do so.
- Pass-Through Mode: Users who attempt to download an IMCE file via an inline link rather than the IMCE browser will only be allowed do do so if IMCE would allow them to browse the directory that contains the file.
If Drupal's Private Files are not enabled, this module has no effect.
What problem does this module solve? Do I even need it?
- If you have only public files, you do not need this module.
- If you have a mixture of public and private files (or only private files),
but you force users to access the files through IMCE's browser, then you do not
need this module - you can simply "Disable serving of private files" instead, on the IMCE configuration page. - If on the other hand you have a mixture of public and private files (or only private files), you want files to be available by direct link, but you want access control over those links, then you need this module.
I'm not sure I understand. What's the problem?
With Drupal's default public file system, content creators can attach a file to
a node, and that file is instantly available to any anonymous user who has the direct link. The file lives at a URL likehttps://your.site/sites/default/files/MySensitiveDocument.pdf, and anyone with that direct URL can access the file, regardless of the access permissions of the node to which the file was attached.
When using Drupal's private file system without IMCE, content creators can attach a file to a node, and the file will inherit the permissions of the node
to which it is attached. I the content creater were to then add a link to that file inline (e.g. by entering<a href="system/files/private/path/to/file.pdf">My File</a> into a Body field), either in that node or even in a different node, that link wouldn't work for
unauthorized users.
When using IMCE (with or without Drupal's private file system), IMCE includes an access control mechanism to manage permissions within its file browser. If you grant a user (via Roles and IMCE Profiles) the right to "browse" a directory, then that user can download files within that directory through IMCE. By default, if a user has the Drupal private file system URL to the file (e.g. "https://your.site/system/files/private/path/to/file.pdf"),
that user can download that file whether or not their IMCE Role/Profile combination would allow it. IMCE will let you shut direct downloads off completely, or allow them from everyone.
In other words, IMCE only supports two security models when using Private Files:
- EITHER refuse file downloads directly from the URL, and force everyone to use the file browser at all times,
- OR allow all file downloads directly from the URL, regardless of what the permissions on that file should be.
If you want to be able to include direct links to files inline within content or in email blasts or some other case, but you don't want those files to become available anonymously, then you need this module.
