function gdpr_tasks_file_access in General Data Protection Regulation 8.2
Same name and namespace in other branches
- 8 modules/gdpr_tasks/gdpr_tasks.module \gdpr_tasks_file_access()
- 3.0.x 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();
}