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