function media_gallery_view_item_access in Media Gallery 7
Same name and namespace in other branches
- 7.2 media_gallery.module \media_gallery_view_item_access()
Access callback for viewing a media item in a gallery.
Parameters
$node: The gallery node object.
$file: The file to view.
Return value
TRUE if access is granted; FALSE otherwise.
1 string reference to 'media_gallery_view_item_access'
- media_gallery_menu in ./
media_gallery.module - Implements hook_menu().
File
- ./
media_gallery.module, line 1496
Code
function media_gallery_view_item_access($node, $file) {
// Only grant access if the user can view the gallery and the provided media.
return media_gallery_view_access($node) && media_access('view') && in_array($file->fid, media_gallery_get_file_ids($node));
}