Remove the IS_ACCESS_GROUPS_ENABLED feature flag

Merged
CH
10d ago
+47-243

Why

Access groups are being enabled on every workspace ahead of this PR, so IS_ACCESS_GROUPS_ENABLED no longer needs to gate anything. This removes the flag and keeps the flag-on behaviour: record listings restricted by a row-level rule always read the stored access groups. Fourth of a series removing flags one PR at a time (after #31458, #31474 and #31485).

Prerequisite

Do not merge before the flag is on in every workspace and its access group sync has finished. Nothing in this PR computes access groups for a workspace that never had the flag: such a workspace would filter restricted members against _accessGroupIds columns that were never filled.

What changes

  • resolveRecordsAccessSQLConditionStrategy returns accessGroups whenever the main role is restricted by a row-level rule. The degradedRead strategy is removed from the type.
  • AccessGroupSyncSchedulerService loses isEnabled, and scheduleSyncIfEnabled becomes scheduleSync. The listener no longer checks the flag before refreshing members or scheduling a sync, and no longer lists the flag among those that trigger a sync.
  • RecordAccessGroupWriteService no longer takes featureFlagsMap: the write transaction, records-before-write, related-records-before-delete and recompute-after-write paths always run.
  • Related record paths are always resolved in buildRelatedRecordPathJoinSQLCondition and findRelatedRecordPathsExtendingAccess, still subject to IS_RELATED_RECORD_PATHS_ENABLED.
  • isRlsRelationHopEnabled only reads IS_ROW_LEVEL_PERMISSION_RELATION_HOP_ENABLED.
  • PrivateRecordSystemWriteService always recomputes records following related record paths, and recompute-record-access-group-ids no longer skips workspaces without the flag.
  • isAccessGroupsEnabled is deleted. The key is removed from FeatureFlagKey, the dev seeder, the admin panel list and the generated schemas (front and client SDK).
  • The 2.61 type-access-groups command calls the renamed scheduleSync. That is its only change, and it needs the ci:allow-previous-version-upgrade-mutation label.

Not removed: the rule-to-SQL rendering in buildRlsAccessSQLCondition. Write checks still go through it, since they do not pass access group ids.

Tests

  • Unit specs drop the flag parameter and the three flag-off cases.
  • Integration specs stop toggling the flag. access-group-sync schedules the sync directly where it relied on the flag-enabled event, and query-many-records-through-access-groups drops the flag-off half of one case.
  • Every other integration spec that sets a row-level rule now reads through access groups instead of the rule. Those were not run locally.

Screenshots

No UI change.

Validation

Server typecheck, lint:diff-with-main on server and front, and the permissions and twenty-orm unit suites (99 suites, 912 tests).