You are here

function gdpr_tasks_file_access in General Data Protection Regulation 3.0.x

Same name and namespace in other branches
  1. 8.2 modules/gdpr_tasks/gdpr_tasks.module \gdpr_tasks_file_access()
  2. 8 modules/gdpr_tasks/gdpr_tasks.module \gdpr_tasks_file_access()

Implements hook_ENTITY_TYPE_access().

File

modules/gdpr_tasks/gdpr_tasks.module, line 53
Module file for the GDPR Tasks module.

Code

function gdpr_tasks_file_access(FileInterface $file, $operation, AccountInterface $account) {
  if ('download' === $operation && $file
    ->getOwnerId() === $account
    ->id()) {
    return AccessResult::allowed();
  }
  return AccessResult::neutral();
}