Download is recorded when user is given access denied

Created on 30 April 2024, 7 months ago
Updated 12 July 2024, 4 months ago

Problem/Motivation

When using this module in a scenario where a user does not have access to the file being downloaded the module is still recording and logging a download for that user.

Steps to reproduce

  1. Install this module on standard profile
  2. Configure a private file field on a node
  3. Save a node with a file as unpublished
  4. Try to access the file as an anonymous user
  5. Run cron
  6. The report incorrectly shows the file as being downloaded
  7. The log contains an incorrect message that the file was download by uid 0

Proposed resolution

Refactor the module to be access aware, only tracking when the file has actually been downloaded.

Using hook_file_access is problematic as it does not factor in what other modules have returned.

Remaining tasks

  1. Design solution / agree on approach
  2. Implement
  3. Review
  4. Commit

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand ericgsmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024