Skip to content

Commit

Permalink
Add file access check to IIIF manifest generation. (Islandora#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-vessey authored and rosiel committed Dec 14, 2022
1 parent c93930a commit e556cbc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ protected function getTileSourceFromRow(ResultRow $row, $iiif_address, $iiif_bas
/** @var \Drupal\Core\Field\FieldItemListInterface $images */
$images = $entity->{$viewsField->definition['field_name']};
foreach ($images as $image) {
if (!$image->entity->access('view')) {
// If the user does not have permission to view the file, skip it.
continue;
}
// Create the IIIF URL for this file
// Visiting $iiif_url will resolve to the info.json for the image.
$file_url = $image->entity->createFileUrl(FALSE);
Expand Down

0 comments on commit e556cbc

Please sign in to comment.