Review main Ready for review

97322[FEATURE] Decide page permissions with a security voter

Benni Mack CR 0 V 0 Expert +1489 −151 updated 11/18/26, 19:32

Commit message

The page permissions of backend users are decided by
BackendUserAuthentication: the SQL clause of getPagePermsClause(),
the webmount check of isInWebMount() and the permission bitmask of
calcPerms(). Voters of the authorization checker can not use them
without the user object.

The internal PagePermissionEvaluator now decides on page permissions
for a PageAccessContext: the user, its groups and the mounts of the
request. The three methods of BackendUserAuthentication delegate to
it. The clause is kept for the request per user, groups and
permissions.

The PageVoter decides on Page objects for the scopes read, update,
delete, create and the new scope update_content. The backend stores
the webmounts and the workspace of the user as BackendMountContext on
the PrincipalToken, as neither belongs to the principal. The file
mounts and storages of the user are part of the context as well, and
are resolved on first access only.

The hooks getPagePermsClause and calcPerms are deprecated in favour of
the new PSR-14 events ModifyPagePermissionClauseEvent and
ModifyPagePermissionsEvent. Listeners of the clause event build
constraints with an expression builder instead of SQL strings. The
events apply to the voter and to the methods of
BackendUserAuthentication alike. While a listener of the clause event
or the deprecated hook is registered, the webmount check walks the page
tree with the constraint.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 12
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/22/97322/12 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/22/97322/12 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Relation chain 5

  1. main 96852[TASK] Add check whether a user may read a field Based on this change Merge conflict Oli Bartsch CR 0 V 0 Hard +320 −3
  2. main 96580[TASK] Add check whether a user may read a record Based on this change Merge conflict Oli Bartsch CR 0 V 0 Expert +1773 −28
  3. main 97323[TASK] Check page access along the cached page ancestry Based on this change Merge conflict Benni Mack CR 0 V 0 Normal +166 −1
  4. 97322 [FEATURE] Decide page permissions with a security voter This change

  5. main 95784[FEATURE] Decide table, field and language access with voters This change is based on it Thomas Maroschik CR +1 V +1 unified-identity-security-kernel Expert +1215 −11

Merge conflicts 11

Issues 2

Files 18

Review log 1222

  1. Benni Mack uploaded patch set 1 11/03/26, 14:43

  2. core-ci voted on patch set 1 V +1 11/03/26, 15:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113168

  3. Benni Mack uploaded patch set 2 V +1 11/09/26, 10:12

  4. core-ci voted on patch set 2 V -1 11/09/26, 10:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113644

  5. Benni Mack uploaded patch set 3 V -1 11/10/26, 20:26

  6. core-ci voted on patch set 3 V -1 11/10/26, 20:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113951

  7. Benni Mack rebased onto patch set 4 V -1 11/13/26, 14:31

  8. Benni Mack rebased onto patch set 5 11/13/26, 19:02

  9. Benni Mack rebased onto patch set 6 11/13/26, 20:59

  10. core-ci voted on patch set 6 V +1 11/13/26, 22:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114401

  11. Benni Mack rebased onto patch set 7 V +1 11/17/26, 15:48

  12. core-ci voted on patch set 7 V +1 11/17/26, 16:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114759

  13. Benni Mack uploaded patch set 8 V +1 11/17/26, 18:50

  14. core-ci voted on patch set 8 V -1 11/17/26, 19:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114782

  15. Benni Mack uploaded patch set 9 V -1 11/18/26, 08:04

  16. core-ci voted on patch set 9 V +1 11/18/26, 08:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114829

  17. Benni Mack rebased onto patch set 10 V +1 11/18/26, 10:35

  18. core-ci voted on patch set 10 V +1 11/18/26, 10:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114849

  19. Benni Mack rebased onto patch set 11 V +1 11/18/26, 19:05

  20. Benni Mack rebased onto patch set 12 11/18/26, 19:16

  21. core-ci voted on patch set 11 V +1 11/18/26, 19:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114907

  22. core-ci voted on patch set 12 V +1 11/18/26, 19:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114915