Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
96580[TASK] Add check whether a user may read a record
Commit message
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 4
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/80/96580/4 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/80/96580/4 && 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 10
- main 96664[TASK] Resolve page and record references
- main 96661[TASK] Add capability invoker and registry
- main 96660[TASK] Derive argument schemas from signatures
- main 96582[TASK] Use the record read access check in backend
- main 96581[TASK] Add query restriction for records a user may read
- main 96852[TASK] Add check whether a user may read a field
-
96580 [TASK] Add check whether a user may read a record This change
- main 97323[TASK] Check page access along the cached page ancestry
- main 97322[FEATURE] Decide page permissions with a security voter
- main 95784[FEATURE] Decide table, field and language access with voters
Issues 4
Files 17
- typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php2+11 −18
- typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php+3 −1
- typo3/sysext/backend/Tests/Functional/Controller/ContentElement/Fixtures/ElementInformationAccess.csvnew+26 −0
- typo3/sysext/backend/Tests/Functional/Controller/ContentElement/ElementInformationControllerAccessTest.phpnew+108 −0
- typo3/sysext/backend/Tests/Functional/Controller/Wizard/SuggestWizardControllerTest.php+7 −0
- typo3/sysext/backend/Tests/Functional/Form/Wizard/Fixtures/SuggestWizardAccess.csvnew+22 −0
- typo3/sysext/backend/Tests/Functional/Form/Wizard/SuggestWizardDefaultReceiverTest.php+54 −9
- typo3/sysext/core/Classes/Authentication/ReadablePageResolver.phpnew+185 −0
- typo3/sysext/core/Classes/Authentication/RecordReadAccessCheck.phpnew+125 −0
- typo3/sysext/core/Classes/Database/Query/Restriction/RecordReadAccessRestriction.php7new+168 −0
- typo3/sysext/core/Classes/Database/Query/Restriction/RecordReadAccessRestrictionFactory.phpnew+81 −0
- typo3/sysext/core/Classes/Security/Authorization/Subject/RecordRow.phpnew+44 −0
- typo3/sysext/core/Classes/Security/Authorization/Voter/RecordVoter.phpnew+169 −0
- typo3/sysext/core/Classes/Security/Authorization/BackendMountContext.php+16 −0
- typo3/sysext/core/Tests/Functional/Authentication/Fixtures/RecordReadAccess.csvnew+63 −0
- typo3/sysext/core/Tests/Functional/Authentication/RecordReadAccessCheckTest.phpnew+131 −0
- typo3/sysext/core/Tests/Functional/Database/Query/Restriction/RecordReadAccessRestrictionTest.phpnew+560 −0
Review log 711
-
Oli Bartsch uploaded patch set 1 10/09/26, 20:34
-
core-ci voted on patch set 1 V +1 10/09/26, 20:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110713
-
Oli Bartsch uploaded patch set 2
V +110/14/26, 06:42 -
core-ci voted on patch set 2 V +1 10/14/26, 07:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111042
-
Benni Mack commented on patch set 2 CR -1 10/18/26, 17:09
RecordReadAccessRestriction.php:42Restrictions in core so far only build expressions. This one walks the page tree, loads move pointers and writes to the runtime cache whenever the SQL is built (RecordReadAccessRestriction.php:76 → getReadablePageIds()). How about: resolve everything before the query is built, and keep the restriction a plain value object: ``` final readonly class RecordReadAccessRestrictionFactory { public function __construct( private ReadablePageResolver $readablePageResolver, private TcaSchemaFactory $tcaSchemaFactory, ) {} public function create(BackendUserAuthentication $backendUser): QueryRestrictionInterface { // admin → no-op restriction; otherwise readable page ids + denied tables } } ``` This way we do not need to have all these makeInstance = hidden dependencies.RecordReadAccessRestriction.php:95I assume we cannot handle moved records yet?RecordReadAccessRestriction.php:209this is like a SQL query in a Expression. How about we use a CTE to get subpages with the permissions in mind from a user in a separate service? We could then cache this once and pump into this restriction, this would benefit the whole core. -
Oli Bartsch uploaded patch set 3
CR -1V +110/19/26, 07:27 -
Oli Bartsch commented on patch set 3 10/19/26, 07:36
ElementInformationController.php:97ReplyLoads the record once now (getRecordWSOL()) and checks that row with the new checkRecord(). The pages case keeps the live uid as before. Not showing the reason is intentional: missing and unreadable records should look the same.RecordReadAccessRestriction.php:42ReplyRecordReadAccessRestrictionFactory resolves everything up front, and the restriction is now a value object.RecordReadAccessRestriction.php:95ReplyGood catch, that was a bug. Moved records are now restricted by their move pointer, like the check.RecordReadAccessRestriction.php:209ReplyReadablePageResolver uses one recursive CTE and caches the result. The IDs still end up as IN(...). If you'd rather have the CTE as a subquery in the restriction, I can switch. -
core-ci voted on patch set 3 V +1 10/19/26, 07:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111587
-
Oli Bartsch commented on patch set 3 10/22/26, 19:59
RecordReadAccessRestriction.php:209Reply Unresolved@benni@typo3.org how to proceed? -
Benni Mack uploaded patch set 4
V +111/18/26, 20:33 -
core-ci voted on patch set 4 V +1 11/18/26, 20:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114922
ElementInformationController.php:97