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
contentsite setting keyedentity_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 (getSitesContainingEntityvsgetSiteCandidatesForEntity). Non-queryable sites are supported everywhere — only sites implementingQueryableSiteInterfacedeal 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
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