Skip to content

fedms_federation

The structural backbone of FedMS. Owns the three group types, their fields, the federation hooks, the group-relationship status field, and the declarative roles/permissions configuration.

GitLab

fedms/components/federation

What it ships

Group types

Three group bundles, defined as group.type.* config entities:

Bundle Purpose
org Top-level organization unit.
event Sub-group of an org.
session Sub-group of an event.

All three are subgroup-aware via subgroup:subgroup.

Group fields

A rich set of fields per bundle. See Concepts → Organizations, Events, Sessions.

Notable fields:

  • field_gitlab_id (org) — federation anchor.
  • field_sync (event, session) — federation sync marker.
  • field_flag_start_processed, field_flag_end_processed (event, session) — lifecycle flags consumed by task_api ECA model.
  • field_date (event, session) — smart-date window.

Group relationship types

The full matrix of relationship types — org-group_media-*, event-group_media-*, session-group_media-*, org-group_node-*, event-group_node-*, session-group_node-*, org-subgroup-event, event-subgroup-session, and the three *-group_membership types.

Views

Federation-level views that drive the dashboards and the cron-based lifecycle processing:

  • views.view.orgs
  • views.view.organizations
  • views.view.upcoming_events
  • views.view.upcoming_events_globally
  • views.view.event_sessions
  • views.view.group_members
  • views.view.group_memberships
  • views.view.group_media
  • views.view.group_users
  • views.view.groups_unprocessed — used by cron to walk unprocessed lifecycle events.
  • views.view.content

Pathauto patterns

  • pathauto.pattern.group_orgs
  • pathauto.pattern.group_events
  • pathauto.pattern.group_sessions

Roles and permissions

The declarative permission map at config/roles_permissions.yml. See Group roles.

Hooks (src/Hook/EntityHooks.php)

The federation module exposes its hooks through a single class using the Drupal 11 #[Hook] attribute style:

entityQueryGroupRelationshipAlter

Reserved for status-aware filtering of group_relationship queries. Currently a no-op while the design is being finalized.

entityBaseFieldInfo

Adds a status boolean base field to group_relationship. This is the soft-delete switch — when set to FALSE, the relationship is "removed" but the record is preserved.

ginContentFormRoutes

Registers the group add/edit forms with the Gin theme so they get the Gin admin layout:

  • entity.group.add_form
  • entity.group.edit_form
  • entity.group_relationship.create_form
  • entity.group_relationship.edit_form

queryEntityReferenceAlter

The federation's most important hook. Alters entity-reference queries when the reference target is user and we're rendering on a group page. Two behaviors:

  1. Exclude existing members. Users already members of the current group are removed from the picker — so you can't "add" someone twice.
  2. Restrict sessions to parent-event members. If the group is a session, only users who are members of the parent event are offered. This is the load-bearing access constraint for sessions. Do not bypass.

The hook reads the current request's referer to discover the group context, validates the URL, and applies the SQL condition directly to the query.

groupRelationshipInsert (after subgroup)

Re-runs pathauto's alias creation after the subgroup module finishes its own insert handling, so the resulting alias reflects the freshly-installed subgroup hierarchy.

Module dependencies

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
- address:address
- color_field:color_field
- drupal:telephone
- drupal:taxonomy
- fedms_content:fedms_content
- group:gnode
- group:group
- groupmedia:groupmedia
- pathauto:pathauto
- smart_date:smart_date
- subgroup:subgroup

When to change this module

  • Adding a field to org, event, or session group.
  • Changing the membership-restriction policy on sessions.
  • Adding a new view that lists groups / memberships globally.
  • Adjusting the role-to-permission map (in config/roles_permissions.yml).
  • Implementing federation transport (when the work lands).

When not to change this module

  • Changing fedms_event / fedms_session content fields — those belong to fedms_content.
  • Changing task behavior — that belongs to fedms_task or fedms_eca.
  • Adding tenant-specific content or types.

Next steps