123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- function hook_file_download_access($file_item, $entity_type, $entity) {
- if ($entity_type == 'node') {
- return node_access('view', $entity);
- }
- }
- function hook_file_download_access_alter(&$grants, $file_item, $entity_type, $entity) {
-
- if (isset($grants['node'])) {
- $grants = array('node' => $grants['node']);
- }
- }
|