public function onPermissionUpdate(PermissionUpdateEvent $permissionUpdateEvent) { if ($permissionUpdateEvent->getType() !== SecurityBehavior::class) { return; } $document = $this->documentManager->find($permissionUpdateEvent->getIdentifier()); $this->searchManager->deindex($document); }
/** * Removes all FileVersionMetas belonging to the collection, which just got secured. * * @param PermissionUpdateEvent $event */ public function onPermissionUpdate(PermissionUpdateEvent $event) { if ($event->getType() !== Collection::class) { return; } foreach ($this->fileVersionMetaRepository->findByCollectionId($event->getIdentifier()) as $fileVersionMeta) { $this->searchManager->deindex($fileVersionMeta); } }