Skip to content

New: Drop legacy access fields (_isShared/_shareWithUsers/userGroups) — contract step #224

Description

@taylortom

Context

Final contract step of the generic _access migration — see adapt-security/adapt-authoring-api#98 (migration step 4). Runs only after the enforcement switch + UI patches have shipped and the new _access.* reads are verified in production.

Summary

A DataMigration to drop the now-unused legacy access fields once all reads/writes use _access.*:

  • _isShared, _shareWithUsers (content / courses)
  • userGroups (content / courses + assets) — coordinate with usergroups, which owns that mapping

Caveats

  • Sequence after the switch. Dropping legacy fields before the new reads + both UIs are live reopens the access-gap window (Import hooks not running on UI import #98). Do not run early.
  • Replica-set / DDL. $unset of fields is a data mutation (safe under the migration runner's transactions). But if any indexes exist on these fields, dropping an index is DDL and fails on replica sets / Atlas (see the adapt-authoring-migrations transaction gap). Check for and drop such indexes outside the transacted migration.
  • Idempotent. Scope each .where(...) to docs that still carry a legacy field.

Dependencies

  • Requires the switch release (UI widgets + enforcement) to be live and verified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions