Group membership model + join/leave actions

Updated 2026-07-22: foundation is the Group module (drupal/group) per André — group entities + group permission mechanism + customized Group membership relationship; OG still excluded.

Problem / Motivation

Join/leave are Must Have, and organizers must manage members and statuses.

Proposed resolution

Build customized membership on the Group module's membership relationship — the group_membership group_relationship type in drupal/group, extended with the fields the MVP needs: status (member/organizer/moderator/pending/blocked — finalize), joined date, last updated — plus the corresponding group roles. This tailors Group's built-in membership relationship rather than inventing a Group-less standalone entity.

Provide CSRF-protected actions:

  • Join Group (authenticated users, per join policy) — creates the group_membership relationship.
  • Leave Group (members) — removes it.
  • Organizer management handled in the membership-management issue (#3578786).

Drupal-specific

  • Build on drupal/group (the Group module), extending its group_membership relationship. Do not pull in Organic Groups (drupal/og) — note OG is a different, older module than the Group module; excluding OG does not exclude drupal/group.
  • Use CSRF-protected POST forms for join/leave.

Acceptance criteria

  • A user can join and leave a public (open-policy) Group (a group_membership relationship is created/removed).
  • Membership status persists on the extended relationship and is reflected in the UI (e.g. “You are a member”).
  • Duplicate memberships are prevented (Group enforces one membership per user per group).

Pipeline

Suggested review-rigor: panel — a state-changing POST with CSRF, access, and idempotency (double-join) surface; ideal to show the panel catching a security defect at the diff gate. UI surface: Join / Leave buttons with state (Designer wireframe + UI walkthrough apply).

Source: DA-New Groups — MVP PRD (Google Doc). Target Drupal core version per the project's core-version decision (see #3578750).

Part of the MVP epic #3578778.


Proposed approach (reference — not yet decided)

A proposed approach for this exists in the D11 Migration docs (imported via !28 (merged)), reflecting an Open Social → standard Drupal conversion built on the contrib drupal/group module. Treat it as a reference proposal, not a decision — whether this project adopts that schema is still open (see the data-model decision in #3578779). See: Architecture Differences, Runbook.

Edited by André Angelantoni