Issue Task Under Review

#111700The backend preview link has its own copy of the "Extend to Subpages" rule

Matthias Vogel 12/02/26, 07:04 updated 12/02/26, 08:40

Description

PreviewUriBuilder::getAdditionalQueryParametersForAccessRestrictedPages() adds parameters to the preview link of a page. These parameters simulate the frontend user groups and the access time that the page needs. A page also gets the restriction of each ancestor with “Extend to Subpages”.

PreviewUriBuilder has its own copy of this rule and reads the restriction fields by their names. In the frontend, RecordAccessVoter has the same rule and gets the field names from the TCA schema capabilities. Thus a change to one copy can make the backend preview and the frontend give different results.

The backend cannot use the voter for the preview link. The voter tells only if a record grants access. The backend needs the values of the restriction, because it simulates them in the preview link.

Proposal: an internal class finds the restriction of a page and of each ancestor that extends its restriction to subpages. It uses the rule of RecordAccessVoter and the TCA schema capabilities. PreviewUriBuilder uses this class. The behaviour does not change.

Reviews 1

History 23

  1. Matthias Vogel changed Related to #110664 12/02/26, 07:04

  2. Gerrit Code Review pushed patch set 1 for main to change 98274 status New Under Review 12/02/26, 08:40

  3. Matthias Vogel changed Related to #111701 12/02/26, 08:42