Remove the relation hop and related record paths feature flags

Merged
CH
10d ago
+103-643

Why

With access groups always on (#31486), IS_ROW_LEVEL_PERMISSION_RELATION_HOP_ENABLED and IS_RELATED_RECORD_PATHS_ENABLED are the last flags in front of the record access model. This removes both and keeps the flag-on behaviour: rules can compare a field of a related record, and related record paths extend access.

IS_CHANNEL_VISIBILITY_RLS_ENABLED and IS_CHANNEL_VISIBILITY_ENFORCED_ON_API_KEYS are not in this PR. Removing the first one stops masking message and calendar content in the query hooks for every member, and nothing but the manual channel-visibility:revoke-role-wide-access command takes role wide access away, so it would open that content on any workspace where the command has not run, including new ones.

Prerequisite

Both flags should be on in every workspace, with their access group sync finished, before this merges. Turning either flag on schedules the sync that recomputes record access group ids; this PR does not.

What this turns on for every workspace

  • Rules through a relation, rules reading the current member through a relation, and IS_EMPTY / IS_NOT_EMPTY on a one-to-many relation are accepted by the validator and applied on reads and writes.
  • Related record paths, including the standard inherent ones, extend access. The relatedRecordPath resolver no longer requires a flag, and the "Related records" section shows in object settings for anyone with the roles permission.

What changes

  • isRelationHopEnabled is no longer threaded through the rule filter, rule shape, access group and value lookup builders. isRlsRelationHopEnabled is deleted.
  • computeRuleShapeHash used to hash the flag value next to a relation predicate. It now hashes the constant RELATION_PREDICATE_SHAPE_HASH_MARKER = true, so stored rule shape hashes computed with the flag on stay valid and no access group is invalidated.
  • The validator loses its three "not enabled for this workspace" branches and no longer reads additionalCacheDataMaps.
  • RelatedRecordPathReadService and its module are deleted. The two callers read flatRelatedRecordPathMaps from the workspace cache. isRelatedRecordPathsEnabled is deleted.
  • AccessGroupSyncListener no longer listens to feature flag changes, since no flag affects access groups any more. isChannelVisibilityRlsEnabled and its listener only look at the channel visibility flag.
  • featureFlagsMap is dropped where only these flags read it (buildWorkspaceAccessGroups, findRlsRuleRelationPredicatesToObject, AccessGroupReadService, AccessGroupSyncService).
  • Both keys are removed from FeatureFlagKey, the dev seeder, the admin panel list and the generated schemas (front and client SDK). Leftover featureFlag rows are ignored, same as previous flag removals. No upgrade command is touched.

Tests

  • Unit specs drop the parameter and one flag-off case.
  • Integration specs stop toggling the two flags. Two flag-off cases are removed with one snapshot entry, and the endpoint permission snapshot loses the feature flag requirement on the four related record path endpoints. Not run locally.

Screenshots

No screenshot: the only UI change is that the existing "Related records" section of object settings is no longer hidden behind the flag.

Validation

Server typecheck, lint:diff-with-main on server and front, and 513 unit suites (3,279 tests) across permissions, workspace migration and metadata modules.