Install
Works with Drupal: ^10 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
When oci_osfs overrides private:// and a user tries to download a file
attached to a webform submission, access is denied even if the user has
the 'view any webform submission' permission.
Root cause:
oci_osfs_file_download() returns -1 when the user lacks 'access private
files'. Because Drupal's FileDownloadController treats any single -1 from
any module as a final deny, webform's own hook_file_download() (which
checks submission-level permissions) never gets to run.
Note: 'access private files' is not registered in any permissions.yml,
So it can never be granted through the UI, making private file access
impossible for all non-UID-1 users when override_private is enabled.
Fix:
Before the 'access private files' check, look up the file's usage record.
If the file belongs to a webform submission, return NULL to defer control
to webform's hook_file_download(), which applies proper submission-level
access control.
Steps to reproduce:
- Enable oci_osfs with override_private = TRUE
- Install webform module
- Create a webform with a file upload field
- Submit the form with a file
- Grant a role 'view any webform submission' (but NOT 'access private files')
- Log in as that role and try to download the file → Access denied (403)
Expected: Access granted via webform's submission-level check.
Actual: Access denied because oci_osfs returns -1 first.