From 6ce0b49bdbf68ee830f1903434ee088828decaa7 Mon Sep 17 00:00:00 2001
From: Christoph Lehmann <christoph.lehmann@networkteam.com>
Date: Thu, 7 Dec 2017 22:53:35 +0100
Subject: [PATCH] [FOLLOWUP][BUGFIX] Make category tree filterable for editors

Check if TCEFORM.pages.categories.config.treeConfig.rootUid
itself is in the users category mounts (no need for a pseudo
parent category)

Resolves: #83257
Releases: master,8.7,7.6
Change-Id: I8a60860ee3a22d68964f4e44018f0962f7f0f278
Reviewed-on: https://review.typo3.org/54975
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
---
 .../backend/Classes/Security/CategoryPermissionsAspect.php     | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/typo3/sysext/backend/Classes/Security/CategoryPermissionsAspect.php b/typo3/sysext/backend/Classes/Security/CategoryPermissionsAspect.php
index 9df877cd298e..3779ba7925a9 100644
--- a/typo3/sysext/backend/Classes/Security/CategoryPermissionsAspect.php
+++ b/typo3/sysext/backend/Classes/Security/CategoryPermissionsAspect.php
@@ -73,6 +73,9 @@ class CategoryPermissionsAspect
 
                 // Check the rootline against categoryMountPoints when tree was filtered
                 if ($dataProvider->getRootUid() !== null) {
+                    if (in_array($dataProvider->getRootUid(), $categoryMountPoints)) {
+                        return;
+                    }
                     $uidsInRootline = $this->findUidsInRootline($dataProvider->getRootUid());
                     if (!empty(array_intersect($categoryMountPoints, $uidsInRootline))) {
                         // One of the parents was found in categoryMountPoints so all children are secure
-- 
GitLab