Review main Abandoned

65005[BUGFIX] Make Pagetree respect getPagePermsClause()

Torben Hansen CR 0 V 0 Easy +23 −13 updated 08/11/20, 12:59

Commit message

This patch enables the use of getPagePermsClause() for the pagetree
to limit pages in queries for a backend user to only pages the user has
access to.

With #91221 this limitation has been implemented using doctrine
restriction builder, which is wrong, because the hook
['t3lib/class.t3lib_userauthgroup.php']['getPagePermsClause'] is
not respected any more and may break existing installations
as mention in issue #91753.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 2

Review log 1114

  1. Torben Hansen uploaded patch set 1 07/08/20, 18:34

  2. TYPO3com voted on patch set 1 V -1 07/08/20, 18:35 Completed build in 24s on Wed, 8 Jul, 06:35 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4056

  3. Torben Hansen uploaded patch set 2 07/09/20, 03:53

  4. TYPO3com voted on patch set 2 V +1 07/09/20, 04:07 Completed build in 14m 25s on Thu, 9 Jul, 04:07 AM Test Summary: 72872 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4057

  5. Tymoteusz Motylewski commented on patch set 2 07/10/20, 10:28

    PageTreeRepository.php:201

    couldnt this be added to the query restriction?
  6. Torben Hansen commented on patch set 2 07/10/20, 10:55

    PageTreeRepository.php:201 Reply

    Not as far as I know, since getPagePermsClause() returns plain SQL which can be adjusted by a core hook and basically can contain whatever restrictions. See TYPO3\CMS\Backend\Tree\View\BrowseTreeView which has a similar usage of getPagePermsClause().
  7. Benni Mack commented on patch set 2 07/15/20, 21:06

    TreeController.php:422

    we used the callback previously to do that check in the callback, shouldn't we re-add this in the same way?
  8. Torben Hansen commented on patch set 2 07/17/20, 11:23

    > Patch Set 2: > > (1 comment)

    TreeController.php:422 Reply Unresolved

    I think the callback solution may have been dropped in favor of having the page permission evaluation directly in the main query without the need to iterate over all fetched records afterwards, which may take some time for huge pagetrees. From a performance point of view it is best to perform the restrictions at query level, but not as implemented currently (using the PagePermissionRestriction) but as it was in pre v9 using the getPagePermsClause() as additional query constraint. This also enables the use of hooks, that some extensions (e.g. be_acl) rely on to perform additional permission limitations.
  9. Markus Klein commented on patch set 2 07/23/20, 07:22

    Is this one ready for review?
  10. Torben Hansen uploaded patch set 3 07/26/20, 12:43

  11. TYPO3com voted on patch set 3 V -1 07/26/20, 12:55 Completed build in 11m 12s on Sun, 26 Jul, 12:55 PM Test Summary: 12 of 73417 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4255

  12. Richard Haeser commented on patch set 3 08/10/20, 19:15

    As the original patch is reverted, I would opt to implement this in https://review.typo3.org/c/Packages/TYPO3.CMS/+/65208 which is the new patch for an upcoming release with all regression issues fixed. What do you think?
  13. Torben Hansen commented on patch set 3 08/11/20, 04:24

    > Patch Set 3: > > As the original patch is reverted, I would opt to implement this in https://review.typo3.org/c/Packages/TYPO3.CMS/+/65208 which is the new patch for an upcoming release with all regression issues fixed. What do you think? Yes, agree on that.
  14. Richard Haeser abandoned the change 08/11/20, 12:59