Review main Merged

88445[TASK] Streamline DataHandler permission checks

Christian Kuhn CR +2 V +2 Expert +475 −607 updated 06/18/26, 23:10

Commit message

The DataHandler permission check related methods - mainly
those related to recordInfoWithPermissionCheck() are very
hard to call correctly and contain lots of complex details.
They are the source of many database queries when changing
records in the Backend. Earlier attempts to improve the
situation added various caches, even though caching db state
in DataHandler is not a great solution since it can easily
lead to side effects when records are changed multiple times
in one process.

The patch streamlines this area within the DataHandler
significantly: The main strategy is to move the "getting
record facts" (usually using BackendUtility::getRecord())
code up into the calling method and hand these records down
to the permission check methods so they don't need to fetch
the record in question over and over again. This aligns well
with the general strategy of having the record fetching code
in the top level "entry" methods (like moveRecord(),
deleteRecord(), ...) and handing them around. This makes
everything much more deterministic, quicker and maintainable.

The permission check methods typically look at page record
details and check for CONTENT_EDIT flag, ownerships and similar.
The calling code thus has to fetch the page row a record is
attached to. This is relatively straight, even though the code
has to deal with records on pid 0 (zero) correctly.

This refactoring drops four cache properties. The patch saves
quite a few queries. Depending on what is measured, it seems
the number of queries shrink by up to 1/3, especially with
non-admin users.

The v13 backport keeps the old public methods with their
signature as-is to not risk breaking hooks.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 5

Review log 61115

Show 4590 earlier messages
  1. Christian Kuhn uploaded patch set 1 03/03/25, 16:57

  2. core-ci voted on patch set 1 V -1 03/03/25, 17:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75031

  3. Christian Kuhn updated the commit message in patch set 2 V -1 03/03/25, 17:41

  4. core-ci voted on patch set 2 V -1 03/03/25, 17:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75032

  5. Christian Kuhn uploaded patch set 3 V -1 03/05/25, 06:34

  6. core-ci voted on patch set 3 V +1 03/05/25, 06:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75136

  7. Christian Kuhn uploaded patch set 4 V +1 03/05/25, 06:45

  8. core-ci voted on patch set 4 V +1 03/05/25, 06:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75137

  9. Christian Kuhn uploaded patch set 5 V +1 03/05/25, 06:55

  10. core-ci voted on patch set 5 V +1 03/05/25, 07:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75138

  11. Christian Kuhn uploaded patch set 6 V +1 03/05/25, 11:32

  12. core-ci voted on patch set 6 V +1 03/05/25, 11:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75158

  13. Christian Kuhn rebased onto patch set 7 V +1 03/05/25, 14:33

  14. core-ci voted on patch set 7 V +1 03/05/25, 14:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75184

  15. Christian Kuhn uploaded patch set 8 03/07/25, 08:27

    Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**")
  16. core-ci voted on patch set 8 V +1 03/07/25, 08:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75276

  17. Christian Kuhn uploaded patch set 9 V +1 03/07/25, 14:44

  18. core-ci voted on patch set 9 V +1 03/07/25, 14:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75307

  19. Christian Kuhn uploaded patch set 10 V +1 03/07/25, 15:08

  20. core-ci voted on patch set 10 V +1 03/07/25, 15:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75310

  21. Christian Kuhn uploaded patch set 11 V +1 03/07/25, 15:19

  22. core-ci voted on patch set 11 V +1 03/07/25, 15:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75311

  23. Christian Kuhn uploaded patch set 12 V +1 03/07/25, 15:35

  24. core-ci voted on patch set 12 V +1 03/07/25, 15:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75312

  25. Christian Kuhn uploaded patch set 13 V +1 03/07/25, 15:46

  26. Christian Kuhn uploaded patch set 14 03/07/25, 15:48

  27. Christian Kuhn uploaded patch set 15 03/07/25, 15:55

  28. core-ci voted on patch set 13 V -1 03/07/25, 15:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75313

  29. core-ci voted on patch set 14 V -1 03/07/25, 16:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75314

  30. core-ci voted on patch set 15 V -1 03/07/25, 16:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75315

  31. Christian Kuhn uploaded patch set 16 V -1 03/13/25, 15:16

  32. core-ci voted on patch set 16 V +1 03/13/25, 15:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75554

  33. Christian Kuhn uploaded patch set 17 V +1 03/13/25, 15:50

  34. core-ci voted on patch set 17 V +1 03/13/25, 15:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75556

  35. Christian Kuhn uploaded patch set 18 V +1 03/13/25, 15:57

  36. core-ci voted on patch set 18 V +1 03/13/25, 16:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75558

  37. Christian Kuhn uploaded patch set 19 V +1 03/13/25, 16:16

  38. core-ci voted on patch set 19 V +1 03/13/25, 16:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75559

  39. Christian Kuhn uploaded patch set 20 V +1 03/13/25, 16:31

  40. core-ci voted on patch set 20 V +1 03/13/25, 16:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75560

  41. Christian Kuhn uploaded patch set 21 V +1 03/14/25, 12:04

  42. core-ci voted on patch set 21 V -1 03/14/25, 12:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75588

  43. Christian Kuhn uploaded patch set 22 V -1 03/14/25, 12:14

  44. core-ci voted on patch set 22 V +1 03/14/25, 12:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75589

  45. Christian Kuhn uploaded patch set 23 V +1 03/14/25, 12:24

  46. core-ci voted on patch set 23 V +1 03/14/25, 12:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75591

  47. Christian Kuhn uploaded patch set 24 V +1 03/14/25, 12:56

  48. core-ci voted on patch set 24 V +1 03/14/25, 13:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75593

  49. Christian Kuhn uploaded patch set 25 V +1 03/14/25, 13:24

  50. core-ci voted on patch set 25 V +1 03/14/25, 13:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75594

  51. Christian Kuhn uploaded patch set 26 V +1 03/14/25, 14:14

  52. core-ci voted on patch set 26 V +1 03/14/25, 14:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75595

  53. Christian Kuhn uploaded patch set 27 V +1 03/14/25, 14:28

  54. core-ci voted on patch set 27 V +1 03/14/25, 14:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75596

  55. Christian Kuhn uploaded patch set 28 V +1 03/14/25, 14:44

  56. core-ci voted on patch set 28 V +1 03/14/25, 14:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75599

  57. Christian Kuhn uploaded patch set 29 V +1 03/14/25, 15:06

  58. core-ci voted on patch set 29 V +1 03/14/25, 15:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75600

  59. Christian Kuhn uploaded patch set 30 V +1 03/14/25, 15:26

  60. core-ci voted on patch set 30 V +1 03/14/25, 15:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75603

  61. Christian Kuhn uploaded patch set 31 V +1 03/14/25, 15:51

  62. core-ci voted on patch set 31 V +1 03/14/25, 16:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75604

  63. Christian Kuhn uploaded patch set 32 V +1 03/14/25, 16:08

  64. core-ci voted on patch set 32 V +1 03/14/25, 16:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75607

  65. Christian Kuhn uploaded patch set 33 V +1 03/14/25, 16:38

  66. core-ci voted on patch set 33 V +1 03/14/25, 16:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75608

  67. Christian Kuhn uploaded patch set 34 V +1 03/14/25, 16:57

  68. core-ci voted on patch set 34 V +1 03/14/25, 17:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75609

  69. Christian Kuhn uploaded patch set 35 V +1 03/14/25, 17:22

  70. core-ci voted on patch set 35 V +1 03/14/25, 17:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75610

  71. Christian Kuhn uploaded patch set 36 V +1 03/14/25, 20:19

  72. Christian Kuhn uploaded patch set 37 03/14/25, 20:20

  73. core-ci voted on patch set 36 V +1 03/14/25, 20:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75611

  74. core-ci voted on patch set 37 V +1 03/14/25, 20:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75612

  75. Christian Kuhn uploaded patch set 38 V +1 03/14/25, 20:44

  76. core-ci voted on patch set 38 V +1 03/14/25, 20:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75613

  77. Christian Kuhn uploaded patch set 39 V +1 03/14/25, 21:16

  78. core-ci voted on patch set 39 V +1 03/14/25, 21:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75614

  79. Christian Kuhn uploaded patch set 40 V +1 03/14/25, 21:49

  80. core-ci voted on patch set 40 V +1 03/14/25, 21:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75616

  81. Christian Kuhn uploaded patch set 41 V +1 03/14/25, 22:03

  82. core-ci voted on patch set 41 V +1 03/14/25, 22:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75617

  83. Christian Kuhn uploaded patch set 42 V +1 03/14/25, 22:13

  84. core-ci voted on patch set 42 V -1 03/14/25, 22:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75618

  85. Christian Kuhn uploaded patch set 43 V -1 03/14/25, 22:55

  86. core-ci voted on patch set 43 V -1 03/14/25, 23:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75619

  87. Christian Kuhn uploaded patch set 44 V -1 03/14/25, 23:11

  88. core-ci voted on patch set 44 V +1 03/14/25, 23:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75620

  89. Christian Kuhn uploaded patch set 45 V +1 03/14/25, 23:33

  90. core-ci voted on patch set 45 V -1 03/14/25, 23:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75621

  1. Christian Kuhn uploaded patch set 46 V -1 03/15/25, 00:05

  2. core-ci voted on patch set 46 V -1 03/15/25, 00:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75623

  3. Christian Kuhn uploaded patch set 47 V -1 03/15/25, 00:25

  4. core-ci voted on patch set 47 V -1 03/15/25, 00:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75624

  5. Christian Kuhn uploaded patch set 48 V -1 03/15/25, 00:40

  6. core-ci voted on patch set 48 V +1 03/15/25, 00:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75625

  7. Christian Kuhn uploaded patch set 49 V +1 03/17/25, 10:20

  8. core-ci voted on patch set 49 V -1 03/17/25, 10:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75705

  9. Christian Kuhn uploaded patch set 50 V -1 03/17/25, 12:16

  10. core-ci voted on patch set 50 V +1 03/17/25, 12:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75710

  11. Christian Kuhn uploaded patch set 51 V +1 03/17/25, 12:40

  12. Christian Kuhn uploaded patch set 52 03/17/25, 12:42

  13. core-ci voted on patch set 51 V +1 03/17/25, 12:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75711

  14. core-ci voted on patch set 52 V +1 03/17/25, 12:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75712

  15. Christian Kuhn uploaded patch set 53 V +1 03/18/25, 11:41

  16. core-ci voted on patch set 53 V +1 03/18/25, 11:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75775

  17. Christian Kuhn updated the commit message in patch set 54 V +1 03/18/25, 12:04

  18. core-ci voted on patch set 54 V +1 03/18/25, 12:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75776

  19. Stefan Bürk voted on patch set 54 CR +1 03/18/25, 20:56

  20. Stefan Bürk voted on patch set 54 V +1 03/19/25, 02:31

  21. Benni Mack voted on patch set 54 CR +1 V +1 03/19/25, 08:04

  22. Christian Kuhn voted on patch set 54 CR +2 V +2 03/19/25, 08:28

  23. Christian Kuhn merged patch set 55 03/19/25, 08:28

  24. Oliver Hader commented on patch set 55 02/04/26, 11:15

    DataHandler.php:7506

    Handling the root-level-restrictions (e.g. like in `sys_redirect` with `security/ignoreRootLevelRestriction`) seems still to be missing...
  25. Oliver Hader commented on patch set 55 02/04/26, 16:19

    DataHandler.php:7506 Reply