Problem/Motivation

The node revision overview shows a table of override revisions for every site that has one, with dates, authors and log messages. It does so whatever the viewer may do on those sites, so an editor of one site reads the override history of all the others.

On current Sites 1.x the form decorator also imports SitePluginManagerInterface from its old namespace, which ends every admin page that runs a form decorator in a TypeError.

The module has alpha releases only, so this goes through the public queue.

Steps to reproduce

  1. Create two sites, A and B, and a node shared to both with an override on each.
  2. Log in as an account that may override content on site A only and may view the node's revisions.
  3. Open the node's Revisions tab: the override tables of A and B both show.

Proposed resolution

  • Show a site's table only to an account with override access on that site (SitesContentOverridesServiceInterface::overrideAccess()) or a real global "Administer sites", carry the cacheability of those access results, and head each table with the site's label.
  • Remove the leftover sites_group branch; that module is archived.
  • Import SitePluginManagerInterface from Drupal\sites\Plugin.
  • Tidy the UI texts and docblocks that the generated reference of the Sites documentation shows, and point the README to it.

A new functional test, RevisionOverviewSiteAccessTest, covers the access part.

Remaining tasks

Review the merge request.

Issue fork sites_diff-3630294

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hydra created an issue. See original summary.

hydra’s picture

Status: Active » Needs review

I opened MR !6 for this.

The main change is in RevisionOverviewFormDecorator: a site's override table on the Revisions tab now only shows up for someone who may override the node on that site, or who holds a real global "Administer sites". The access results' cacheability goes onto the form, so a cached page never leaks a table to the wrong person. Each table is now headed by the site's label, and the old sites_group branch is gone since that module is archived.

While I was in there I fixed a few smaller things:

  • the import of SitePluginManagerInterface pointed to the namespace it had before, which broke every admin page that runs a form decorator with a TypeError on current Sites 1.x;
  • the decorator's injected services are no longer readonly, because DependencySerializationTrait can't restore them on PHP 8.3; that also let me drop two stale entries from the PHPStan baseline;
  • the UI texts and docblocks that the Sites documentation pulls into its generated reference got a pass, and the README now points there.

RevisionOverviewSiteAccessTest covers the access part with an editor who may override on one site only. I kept the commits separate on purpose, each one stands on its own.

Setting this to Needs review.