From 304c37cc097fc3ee895bfdcda9f2bc741a128ab0 Mon Sep 17 00:00:00 2001 From: Achim Fritz Date: Wed, 4 Dec 2024 07:40:19 +0100 Subject: [PATCH] [WIP] queryBuilder restricionts --- Classes/Domain/Factory/Database.php | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/Classes/Domain/Factory/Database.php b/Classes/Domain/Factory/Database.php index cebcf6f0..c27a7f82 100644 --- a/Classes/Domain/Factory/Database.php +++ b/Classes/Domain/Factory/Database.php @@ -48,25 +48,10 @@ public function __construct(Context $context) protected function getQueryBuilder(): QueryBuilder { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content'); - if ($this->getServerRequest() instanceof ServerRequestInterface - && ApplicationType::fromRequest($this->getServerRequest())->isFrontend() - ) { - $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class)); - if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) { - // do not use FrontendWorkspaceRestriction - $queryBuilder->getRestrictions() - ->removeByType(FrontendWorkspaceRestriction::class) - ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->workspaceId)); - } - if ($this->workspaceId > 0) { - $queryBuilder->getRestrictions()->removeByType(HiddenRestriction::class); - } - } else { - $queryBuilder->getRestrictions() - ->removeAll() - ->add(GeneralUtility::makeInstance(DeletedRestriction::class)) - ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->workspaceId)); - } + $queryBuilder->getRestrictions() + ->removeAll() + ->add(GeneralUtility::makeInstance(DeletedRestriction::class)) + ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->workspaceId)); return $queryBuilder; }