src/Repository/DoctrineMongoODM/Event/AbstractUpdateFilesPermissionsSubscriber.php
public function onFlush(OnFlushEventArgs $args)
    {
        $dm = $args->getDocumentManager();
        $uow = $dm->getUnitOfWork();

        $filter = function ($element) {
            return $element instanceof $this->targetDocument
                   && $element instanceof PermissionsAwareInterface
                   && $element->getPermissions()->hasChanged();
        };

        $inserts = array_filter($uow->getScheduledDocumentInsertions(), $filter);
        $updates = array_filter($uow->getScheduledDocumentUpdates(), $filter);

        $this->process($inserts, $dm, $uow, true);
        $this->process($updates, $dm, $uow);
    }
public function onFlush(OnFlushEventArgs $args)
    {
        $dm = $args->getDocumentManager();
        $uow = $dm->getUnitOfWork();

        $filter = function ($element) {
            return $element instanceof $this->targetDocument
                   && $element instanceof PermissionsAwareInterface
                   && $element->getPermissions()->hasChanged();
        };

        $inserts = array_filter($uow->getScheduledDocumentInsertions(), $filter);
        $updates = array_filter($uow->getScheduledDocumentUpdates(), $filter);

        $this->process($inserts, $dm, $uow, true);
        $this->process($updates, $dm, $uow);
    }
Updates permissions on embedded files.

@param OnFlushEventArgs $args