Stop using writability, sharing reach and non-private readability in favor of disabled object permission actions

Merged
CH
1mo ago
+1019-6014

Follow-up to #29011. Object permissions are now driven by roles plus objectMetadata.disabledObjectPermissionActions. The runtime stops reading object writability, field writability, sharingReach, and every object readability except PRIVATE, which stays until the record permissions rewrite.

Nothing is removed from the data model: the columns, enums, GraphQL fields, manifest types and standard definitions all stay, so the API and published app manifests keep working.

Choices

ConceptChoiceNow expressed as
writability: APPLICATION (object)migratedupdate, soft delete and destroy disabled; the owning app keeps them
readability: APPLICATION (object)migratedread disabled; the owning app keeps it
writability: SYSTEM (object)migrated in the standard appupdate, soft delete and destroy disabled
readability: SYSTEM (object)migrated in the standard appevery action disabled
readability: PRIVATEkept as on mainreadable only through share rows; OWNER share on create; shareWith required from callers that are not members
readability: INHERITEDdroppedplain role access
field writability (APPLICATION, SYSTEM)droppedno field-level equivalent yet
sharingReachdroppednamed grants reach beyond the role whenever sharing is enabled, minus disabled operations

What

  • 2.53 workspace command upgrade:2-53:move-application-and-system-access-to-disabled-actions, run for each workspace:
    • objects with APPLICATION access become OPEN and get the matching disabled actions;
    • objects with SYSTEM access keep their stored value and get the matching disabled actions;
    • existing disabled actions are merged;
    • the object metadata cache is recomputed;
    • --dry-run only counts.
  • Standard app: the SYSTEM objects declare their disabled actions:
    • all four on agentTurn, agentMessage, agentMessagePart, agentMessageReaction, campaignDelivery, messageSuppression, recordShare and shortLink;
    • update, soft delete and destroy on agentChatThreadParticipant, calendarChannelEventAssociation, messageChannelMessageAssociation, messageChannelMessageAssociationMessageFolder and workflowAutomatedTrigger.
  • Disabled actions enforcement:
    • row access policies deny a disabled operation to any subject but the owning application, including webhook delivery;
    • named shares never grant a disabled operation, and objects with nothing left to grant can't be shared beyond the role;
    • roles owned by the object's own application may be granted a disabled action.
  • Server, removed:
    • writability enforcement (API write check, row access policy check, TS_VECTOR rule);
    • inherited readability, including the child snapshots on delete events;
    • SYSTEM and APPLICATION gates;
    • SYSTEM filters on AI tools and navigation commands;
    • sharingReach.
  • Front:
    • writability read-only logic and the command menu restriction are removed; the menu now relies on the permissions the server returns, which already exclude disabled actions;
    • sharingReach no longer affects sharing, and its picker is gone from object settings.
  • Docs: the app docs and the agent skill no longer mention readability, writability or sharing reach.

Impacts (record sharing flag off, as in prod)

  • sharingReach: no impact; it only applied with the flag on.
  • INHERITED objects follow role access: note, noteTarget, task, taskTarget, attachment, timelineActivity, calendarEventTarget, messageThreadTarget, agentChatThreadTarget.
    • A role that reads notes reads every note, including notes on records its row-level filter hides.
    • Chat links (agentChatThreadTarget) to private chats become readable, editable and deletable through role access. The record page Conversations card filters out chats the reader cannot open, so busy records can show fewer or no conversations, and other people's thread ids are exposed. Accepted until the rewrite.
  • SYSTEM objects:
    • Non-admin roles stay blocked through disabled actions.
    • The Standard app's default role is Admin, so Admin keeps these actions. On main, even Admin could not read or write recordShare, agent history or short links.
  • Field writability: SYSTEM fields (136 standard ones including searchVector everywhere, and about 8,700 app fields) and APPLICATION fields become writable by roles that can update the object.
    • In prod, 1,371 of the 1,731 APPLICATION fields sit on app objects whose update is disabled, so they stay protected.
    • 360 fields across 20 workspace apps lose protection: 120 on the app's own OPEN objects and 240 on standard or custom objects such as company, person and opportunity.
    • This is a data integrity loss, not a privacy one.
  • APPLICATION objects:
    • Existing installs keep their protection through the migration.
    • An install or sync of a manifest that still declares APPLICATION without disabledObjectPermissionActions resets the disabled actions to null. That covers Slack, Teams and Fathom (slackUserLink would become forgeable) and the third-party apps still on APPLICATION.
    • The apps can move once twenty-sdk ships disabledObjectPermissionActions; the latest published version, 2.51.3, does not have it.
  • User tokens carrying the owning app: they get user role ∩ app role on app-only objects, so they can no longer write them.
  • Rollout window: until the workspace command reaches a workspace, its APPLICATION and SYSTEM objects follow role access.

Tests

  • Integration:
    • the upgrade command (dry run, APPLICATION and SYSTEM moves, cache refresh, idempotent re-run);
    • chat thread, channel, participant and reaction privacy;
    • workflow run and conversation visibility;
    • record sharing.
  • Unit: server record-share, twenty-orm, api, metadata modules and workspace manager; front record sharing, side panel and read-only utils.
  • Removed or reduced: specs for INHERITED, SYSTEM readability gates, APPLICATION gates, writability and sharing reach.