Merge conflict

Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review

98275[BUGFIX] Simulate restricted ancestors in preview

Matthias Vogel CR 0 V 0 Hard +538 −83 updated 12/02/26, 09:02

Commit message

A page can have two or more ancestors with "extendToSubpages" set.
The frontend checks the restriction of the page and of each of these
ancestors. The preview link of the page simulates the user groups and
the access time of one page only. Thus the frontend denies the preview
with a 403 response.

The link must pass all restrictions that the frontend checks for a
visitor. A restriction that grants access needs no simulation.

The new internal method RecordAccessVoter::getRestrictionDenyingAccess()
returns only the values of a restriction that deny access. It
dispatches RecordAccessGrantedEvent in the same way as accessGranted().
Both methods now use the same private checks for the hidden flag, the
start time and the end time. accessGranted() keeps its behaviour.

PageAccessRestrictionResolver now returns only the restrictions that
deny access, for the page and for each ancestor with
"extendToSubpages". It gets them from the new voter method.
AccessRestrictionSimulator now combines all these restrictions and no
longer selects one of them. The link simulates all their user groups,
and an access time after the latest start time and before the earliest
end time.

The caller can give a context that includes hidden and scheduled
records. The workspace preview gives such a backend context. In this
context, no start time and no end time deny access. Thus
AccessRestrictionSimulator makes its own context of a visitor for the
check. This context has the date and the workspace of the given
context, and no frontend user.

The link now simulates all groups that deny access, also when the
given context has a frontend user. The link no longer simulates a
start time or an end time that grants access at the date of the
context.

New tests in PreviewUriBuilderTest and PreviewSimulatorTest cover
restricted ancestors and the context of a backend user. New tests in
RecordAccessVoterTest cover the new voter method.
Show more Show less
Resolves: #111701
Related: #104081
Related: #96778
Releases: main, 14.3
Change-Id: Ie7c07ef9d1d7094ef1894cb30d742fe80fd7c217

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 1
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/75/98275/1 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/75/98275/1 && 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 2

  1. 98275 [BUGFIX] Simulate restricted ancestors in preview This change

  2. 98274[TASK] Find inherited page restrictions in one place This change is based on it Matthias Vogel → main, 14.3 Hard +577 −75 CR 0 V 0 1 unresolved

Issues 3

Files 8

Review log 12

  1. Matthias Vogel uploaded patch set 1 12/02/26, 08:55

  2. core-ci voted on patch set 1 V +1 12/02/26, 09:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/116162