Review main Ready for review

95784[FEATURE] Decide table, field and language access with voters

Thomas Maroschik CR +1 V +1 Expert +1215 −11 updated 11/21/26, 18:37

Commit message

The authorization checker decides on backend modules so far. The
voters of TYPO3 Core now also answer for tables, fields, languages and
resources. None of them reads group data itself: each translates its
subject into a resource and asks one decision service,
PolicyDecisionPointInterface, which answers allow or deny for a
principal, a scope and a resource. The ModuleVoter asks it as well
now, instead of reading the module list itself.

The first implementation decides on the permission lists of the group
data of the backend user object the principal was built from, as
BackendUserAuthentication::check(), checkLanguageAccess() and
checkAuthMode() do: tables, fields, field values, languages, page
types, modules, dashboard widgets, MFA providers and custom options,
for the new scopes read, create, update, delete and write as well as
access. Principals with the role admin, maintainer or system are
granted before any lookup, a principal without a backend user object
is denied; user records are not resolved a second time. Unlike
check(), an empty value or a value listing several items never
matches a grant.

The voters decide what needs a grant at all:

* TableVoter, for a TcaSchema and the scopes read, create, update,
  delete and write: tables marked "adminOnly" are granted to the role
  SecurityRole::ADMIN only; the legacy group data grants all changes
  with tables_modify
* FieldVoter, for a SchemaField: only exclude fields need a grant
* LanguageVoter, for a SiteLanguage
* ResourceVoter, for a ResourceIdentifier as it is, e.g. page types

Functional tests compare the decisions for a set of users and groups
with the results of the legacy checks, so that both stay in line until
the checks of BackendUserAuthentication are migrated. File permissions
and page permissions are not covered yet.

The subjects SchemaField and ResourceIdentifier and the scopes of
Scope are public API, so that extensions can ask for these decisions
and restrict them with voters of their own; the changelog lists every
decision with the database field granting it and the former check.
The voters of TYPO3 Core and the policy decision point are internal.

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 19
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/84/95784/19 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/84/95784/19 && git cherry-pick FETCH_HEAD

Review

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

Relation chain 11

  1. main 95783[TASK] Provide the principal to the authorization checker Based on this change Work in progress Merge conflict Thomas Maroschik CR 0 V -1 unified-identity-security-kernel Normal +100 −8
  2. main 97157[TASK] Decide module access with the authorization checker Based on this change Abandoned Benni Mack CR 0 V 0 Normal +84 −2
  3. main 95787[TASK] Deprecate auth services and addService('auth') Based on this change Abandoned Thomas Maroschik CR 0 V 0 unified-identity-security-kernel Normal +191 −0
  4. main 95786[FEATURE] Authenticate via AuthenticatorManager in user middlewares Based on this change Abandoned Thomas Maroschik CR 0 V 0 unified-identity-security-kernel Hard +370 −37
  5. main 95785[FEATURE] Register tagged authenticators and AuthenticatorManager Based on this change Abandoned Thomas Maroschik CR 0 V 0 unified-identity-security-kernel Hard +454 −0
  6. main 97804[TASK] Delegate backend user permission checks to security voters Based on this change Merge conflict Benni Mack CR 0 V 0 Hard +241 −12
  7. 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
  8. 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
  9. 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
  10. main 97322[FEATURE] Decide page permissions with a security voter Based on this change Benni Mack CR 0 V 0 Expert +1489 −151
  11. 95784 [FEATURE] Decide table, field and language access with voters This change

Merge conflicts 12

Issues 2

Files 17

Review log 2341

Show 916 earlier messages
  1. Thomas Maroschik uploaded patch set 1 09/12/26, 08:29

  2. core-ci voted on patch set 1 V -1 09/12/26, 08:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108390

  3. Thomas Maroschik uploaded patch set 2 V -1 09/12/26, 09:04

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

  5. Thomas Maroschik uploaded patch set 3 V -1 09/12/26, 11:11

  6. core-ci voted on patch set 3 V -1 09/12/26, 11:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108401

  7. Thomas Maroschik uploaded patch set 4 V -1 09/12/26, 11:36

  8. core-ci voted on patch set 4 V -1 09/12/26, 11:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108407

  9. Thomas Maroschik abandoned the change 10/22/26, 16:15

  10. Benni Mack restored the change 10/25/26, 14:19

  11. Benni Mack uploaded patch set 5 V -1 10/25/26, 14:19

  12. core-ci voted on patch set 5 V +1 10/25/26, 14:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112512

  13. Oli Bartsch rebased onto patch set 6 V +1 10/25/26, 19:39

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

  15. Benni Mack rebased onto patch set 7 V +1 10/26/26, 19:41

  16. core-ci voted on patch set 7 V +1 10/26/26, 20:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112609

  1. Benni Mack rebased onto patch set 8 V +1 11/03/26, 14:43

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

  3. Benni Mack rebased onto patch set 9 V +1 11/09/26, 10:12

  4. core-ci voted on patch set 9 V +1 11/09/26, 10:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113641

  5. Benni Mack rebased onto patch set 10 V +1 11/10/26, 20:26

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

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

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

  9. core-ci voted on patch set 12 V +1 11/13/26, 20:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114376

  10. Benni Mack rebased onto patch set 13 V +1 11/13/26, 20:59

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

  12. Benni Mack uploaded patch set 14 V +1 11/17/26, 15:48

  13. core-ci voted on patch set 14 V +1 11/17/26, 15:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114757

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

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

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

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

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

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

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

  21. Benni Mack marked it ready for review 11/18/26, 19:05

  22. Benni Mack uploaded patch set 19 11/18/26, 19:16

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

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

  25. Josua Vogel voted on patch set 19 CR +1 V +1 11/21/26, 18:37