You are here

function media_gallery_edit_item_access in Media Gallery 7

Same name and namespace in other branches
  1. 7.2 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 view.

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 1513

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 media_access('edit') && in_array($file->fid, media_gallery_get_file_ids($node));
}