diff --git a/src/Plugin/search_api/processor/HOCRField.php b/src/Plugin/search_api/processor/HOCRField.php index 08a617a..b6f0ebb 100644 --- a/src/Plugin/search_api/processor/HOCRField.php +++ b/src/Plugin/search_api/processor/HOCRField.php @@ -3,7 +3,6 @@ namespace Drupal\islandora_hocr\Plugin\search_api\processor; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Session\AnonymousUserSession; use Drupal\file\FileInterface; use Drupal\islandora_hocr\Plugin\search_api\processor\Property\HOCRFieldProperty; use Drupal\media\Plugin\media\Source\File; @@ -152,17 +151,12 @@ protected function getFile(NodeInterface $node) : ?FileInterface { $media = $query->execute(); - $anonymous = new AnonymousUserSession(); - foreach ($media as $medium) { /** @var \Drupal\media\MediaInterface $entity */ $entity = $media_storage->load($medium); if (!$entity) { continue; } - elseif (!$entity->access('view', $anonymous, FALSE)) { - continue; - } $source = $entity->getSource(); @@ -171,10 +165,6 @@ protected function getFile(NodeInterface $node) : ?FileInterface { /** @var \Drupal\file\FileInterface $file */ $file = $this->entityTypeManager->getStorage('file')->load($fid); - if (!$file->access('view', $anonymous, FALSE)) { - continue; - } - return $file; } }