Problem/Motivation

This rolls up the architecture work done ahead of the 1.0.0 API freeze. Four things had grown organically and needed settling before the public surface locks: the service layer had become a god-object, entity↔site lookup methods overlapped and some silently dropped non-queryable sites, "which content a site holds" was hardcoded in hooks rather than configurable, and there was no way to grant a user a role scoped to a single site.

Proposed resolution

  • Content as a per-bundle site setting. Replaces the supported-/single-site hooks with a content site setting keyed entity_type:bundle → cardinality (Unlimited or Single site), edited on the site type form. Plugin sites get content support out of the box; hierarchical types (terms, menu links) default to single-site.
  • Entity↔site consolidation. Lookups now pivot on a containsContent() membership primitive; the assignment vs access/canonical split is explicit (getSitesContainingEntity vs getSiteCandidatesForEntity). Non-queryable sites are supported everywhere — only sites implementing QueryableSiteInterface deal with query alters.
  • SitesService decomposition. The god-service is gone, split into five focused services: SiteResolver, UserSiteAccess, SiteContentSupport, SiteContentLocator, SubSiteResolver. All callers migrated.
  • Per-site roles (Layer 1). A user can hold core roles within a single site; those permissions are added on top of global roles while that site is active. Built on the core Access Policy API — no parallel permission system. Assignable roles are chosen per site type; assignment is per user.

Also folds in the release-mechanics fixes already on the branch (cross-site content-removal IDOR, required-site-selection enforcement, public-API BC traps, and O(N)-over-sites perf).

API changes

SitesService / SitesServiceInterface are removed; use the five focused services. SiteWithContentInterface gains containsContent(). Query-alter concerns move behind QueryableSiteInterface.

Data model changes

New site_role_assignment content entity (site, uid, roles[]). New content and roles site settings.

Issue fork sites-3607366

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.

harlor made their first commit to this issue’s fork.

  • hydra committed ef95f2c6 on 1.x
    Issue #3607366 by hydra: Scope and bridge the taxonomy and menu hub...

  • hydra committed cd5dd5f5 on 1.x
    Issue #3607366 by hydra: Reuse the site list for "My sites"; gate the...

  • hydra committed f42209ac on 1.x
    Issue #3607366 by hydra: Remove the node-only operation restore
    
    The...

  • hydra committed 3c05550e on 1.x
    Issue #3607366 by hydra: Surface hub create entry-points for per-site...

  • hydra committed cb87d2c4 on 1.x
    Issue #3607366 by hydra: Grant per-site update/delete on the hub...

  • hydra committed 3f037bfd on 1.x
    Issue #3607366 by hydra: Declare views handler cacheability, break...

  • hydra committed 8c0baddf on 1.x
    Issue #3607366 by hydra: Replace uncacheable access results and drop...

  • hydra committed 16561975 on 1.x
    Issue #3607366 by hydra: Close lifecycle and config-integrity gaps
    
    -...

  • hydra committed d9905beb on 1.x
    Issue #3607366 by hydra: Stop claiming decoration where nothing is...

  • hydra committed d65dde68 on 1.x
    Issue #3607366 by hydra: Clear derived site caches with the definitions...

  • hydra committed 90a8c473 on 1.x
    Issue #3607366 by hydra: Fix four crash paths in forms and site...

  • hydra committed 74b1d649 on 1.x
    Issue #3607366 by hydra: Fix two event priorities that inverted their...

  • hydra committed b751df62 on 1.x
    Issue #3607366 by hydra: Keep per-site role power inside its site
    
    Three...

  • hydra committed 8d2910d7 on 1.x
    Issue #3607366 by hydra: Declare site dependencies for config overrides...

  • hydra committed 2dd0a357 on 1.x
    Issue #3607366 by hydra: Scope the site path-alias form to the user's...

  • hydra committed b5fc772d on 1.x
    Issue #3607366 by hydra: Add rescoped to the cspell project words
    

  • hydra committed 30880991 on 1.x
    Issue #3607366 by hydra: Add hostnames to the cspell project words
    

  • hydra committed 9fc7a261 on 1.x
    Issue #3607366 by hydra: Add an Edit local task to the site detail...

  • hydra committed 1211735b on 1.x
    Issue #3607366 by hydra: Open the hub menu UI to per-site menu managers...

  • hydra committed 6be6d770 on 1.x
    Issue #3607366 by hydra: Invoke and document the site dashboard alter...

  • hydra committed 67fe3016 on 1.x
    Issue #3607366 by hydra: Add the per-site menus dashboard card and link...

  • hydra committed 0e9c251c on 1.x
    Issue #3607366 by hydra: Drop readonly constructor properties on the add...

  • hydra committed b7c47ca4 on 1.x
    Issue #3607366 by hydra: Fix PHPStan and cspell CI failures
    

  • hydra committed 515eee37 on 1.x
    Issue #3607366 by hydra: Resolve the operations hook's canonical site...

  • hydra committed 953c194a on 1.x
    Issue #3607366 by hydra: Ask for the site when adding a link to a per-...

  • hydra committed 17b453ce on 1.x
    Issue #3607366 by hydra: Restore hub listing operations for canonical-...

  • hydra committed 7a93d445 on 1.x
    Issue #3607366 by hydra: Bind canonical edit entitlement to the request'...

  • hydra committed ce66bed4 on 1.x
    Issue #3607366 by hydra: Default the term-overview scope to the user's...

  • hydra committed dc96bf8f on 1.x
    Issue #3607366 by hydra: Drop the "all sites" state where a site...

  • hydra committed af7d8409 on 1.x
    Issue #3607366 by hydra: Make the hub menu list's site filter narrow the...

  • hydra committed 4de88e7a on 1.x
    Issue #3607366 by hydra: Cover menu block cache contexts, hub site...

  • hydra committed d12bb398 on 1.x
    Issue #3607366 by hydra: Enable sites_ui by default on fresh installs...

  • hydra committed 19fde3dc on 1.x
    Issue #3607366 by hydra: Wire sites_menu/sites_taxonomy into recipes,...

  • hydra committed e5512868 on 1.x
    Issue #3607366 by hydra: Enable sites_menu and sites_taxonomy by default...

  • hydra committed 51bd564a on 1.x
    Issue #3607366 by hydra: Extract the taxonomy admin UI into a...

  • hydra committed eaf043b2 on 1.x
    Issue #3607366 by hydra: Extract per-site menus into a sites_menu module...

  • hydra committed 32f024d4 on 1.x
    Issue #3607366 by hydra: Scope "Reset to alphabetical" to the current...

  • hydra committed d3bd9320 on 1.x
    Issue #3607366 by hydra: Hide the menu Delete action in a site context...

  • hydra committed 0139ef77 on 1.x
    Issue #3607366 by hydra: Invalidate the menu/vocab UI gate when the...

  • hydra committed 7489556f on 1.x
    Issue #3607366 by hydra: Intercept the site-picker for controller-based...

  • hydra committed 625d2e3b on 1.x
    Issue #3607366 by hydra: Restrict the vocabulary admin to term...

  • hydra committed 0882152b on 1.x
    Issue #3607366 by hydra: Filter entity references generically via the...

  • hydra committed bebbf5a8 on 1.x
    Issue #3607366 by hydra: Scope the menu-link target autocomplete to the...

  • hydra committed 2d8d1198 on 1.x
    Issue #3607366 by hydra: Return 404 (not 403) for the hidden menu UI in...

  • hydra committed 2bdbb7a9 on 1.x
    Issue #3607366 by hydra: Restrict the menu admin UI to link management...

  • hydra committed d3b412ec on 1.x
    Issue #3607366 by hydra: Scope the menu list to the site's own menus in...

  • hydra committed 67a5434b on 1.x
    Issue #3607366 by hydra: Isolate foreign content at the request gate,...

  • hydra committed 3c19a26d on 1.x
    Issue #3607366 by hydra: Offer the "Remove from site" operation in a...

  • hydra committed d2dada98 on 1.x
    Issue #3607366 by hydra: Restyle the per-site People screen to match /...

  • hydra committed d6821c09 on 1.x
    Issue #3607366 by hydra: Drop the redundant per-site Content tab; deep-...

  • hydra committed 269e95ff on 1.x
    Issue #3607366 by hydra: Rename the add-to-site action to "Add existing...

  • hydra committed b4905da5 on 1.x
    Issue #3607366 by hydra: Default the exposed Sites filter to Any, not...

  • hydra committed da8aa025 on 1.x
    Issue #3607366 by hydra: Keep fleet site listings out of site context +...

  • hydra committed 71488893 on 1.x
    Issue #3607366 by hydra: Cover authenticated default-site-mode behaviour...

  • hydra committed 06daaccc on 1.x
    Issue #3607366 by hydra: Pin the disabled-site preview behavior
    
    Adds a...

  • hydra committed ba546032 on 1.x
    Issue #3607366 by hydra: Implement canonical-only views scope for...

  • hydra committed 1c1ed743 on 1.x
    Issue #3607366 by hydra: Add the ?site_id escalation-guard regression to...

  • hydra committed 302991ae on 1.x
    Issue #3607366 by hydra: Cover the site manager/editor role journey over...

  • hydra committed 09687a9e on 1.x
    Issue #3607366 by hydra: The canonical site owns edits of the canonical...

  • hydra committed f413d67e on 1.x
    Issue #3607366 by hydra: Keep site-management operations out of site...

  • hydra committed c529e29c on 1.x
    Issue #3607366 by hydra: Make content-site query placeholders unique...

  • hydra committed dbf90070 on 1.x
    Issue #3607366 by hydra: Green the merged-results pipeline
    
    Removes...

  • hydra committed 9082b911 on 1.x
    Issue #3607366 by hydra: Stop forcing '_none' into the sites filter — it...

  • hydra committed afbb73e0 on 1.x
    Issue #3607366 by hydra: Harden isolation, index memberships, add the...

  • hydra committed d8675baa on 1.x
    Issue #3607366: Site-scoped media library (sites_media recipe, shared-...

  • hydra committed 2c7c54d0 on 1.x
    Issue #3607366: Per-site logo and favicon
    
    The Appearance setting gains...

  • hydra committed 006f8880 on 1.x
    Issue #3607366: Clean up per-site aliases and pathauto state on site...

  • hydra committed 7b9e4035 on 1.x
    Issue #3607366: Extract the admin UI into a sites_ui submodule
    
    Sites...

  • hydra committed 3b347c0b on 1.x
    Issue #3607366: Site deletion with impact summary and content cleanup...

  • hydra committed dcdb1a96 on 1.x
    Issue #3607366: Add the fast-create site wizard and launch checklist...

  • hydra committed 10f5d9e6 on 1.x
    Issue #3607366: Add "My sites" delegate landing
    
    A user holding only the...

  • hydra committed 4c8ac427 on 1.x
    Issue #3607366: Rename hub to "Sites configuration", add hub glyphs +...

  • hydra committed 35edd761 on 1.x
    Issue #3607366: Add breadcrumb builder for the Sites admin section...