004: Membership, role assignment and claims¶
Status: accepted, 2026-08-23 (written down 2026-11-08).
Context¶
Three relations tie users and content to sites, and they answer different questions:
| Relation | Question | Owner |
|---|---|---|
| Membership | Is this user or entity content of the site? | sites.membership (SiteMembershipInterface) |
| Role assignment | What may this user do on the site? | sites.site_role_manager (SiteRoleManagerInterface) |
| Claim | Which site serves this route? | sites.resolver, a site's applies() |
Requiring membership for a per-site role was tried and broke six tests that pin the intended behaviour. Test docblocks kept describing that gate after it was decided against.
Decision¶
A role assigned on a site is authority on that site, whether or not the account is a member of it. No capability answer pairs an assignment with a membership check. Membership gates global capabilities that are scoped to a site's content and the preview of a disabled site; a claim decides site context, never ownership.
Consequences¶
- Removing a member keeps the role assignment and its permissions. Removing the assignment removes them.
- A site manager can manage a site's people without being one of them.
- These tests pin the rule:
SiteRolesTest::testAssignmentOutlivesMembershipSiteRolesTest::testGlobalPermissionAppliesOnNonMemberSiteSiteRolesTest::testGlobalAdminAppliesOnNonMemberSiteSiteContentTest::testAssignedRoleGrantsCapabilityWithoutMembershipEntityAccessTestpins that ownership is membership, not a claim.
Rejected options¶
- Membership-gated per-site roles: an assignment without membership would be a dead row, and managing people would require being content of the site.
- Ownership by claim: a site claiming a route by its own logic would own the content it serves.
Reopen when¶
Customers need an assignment that lapses with membership, for example contractors whose access ends with their membership.
Last updated 2026-11-08