Skip to main content

Product decision

Decision (4 December 2026). Status: implemented. Scope: the Co-programming activity in Meet calls (apps/meet, and Parley where it embeds the Meet call). One rule also reaches standalone shared playgrounds, because their code rooms run on the same server: a view-only participant’s cursor, selection and pointer are hidden from everyone else. Edit and run rights outside meetings are unchanged. Default: only the host and room admins may edit the shared code, run it, and broadcast their cursor, selection and pointer. Everyone else is view-only. They follow the code live, can scroll and copy it, and see run results.

Host controls

Room admins open Permissions above the shared code: A participant who may not edit sees Ask to edit. A raised hand reaches every room admin as a toast with Allow and Decline. A participant who tries to type while view-only sees a hint pointing at Ask to edit. Changes apply live and last for the session: the policy is part of the room’s settings (settings.programmingAccess), not the database.

Permission matrix

Enforcement

  • Room service (packages/realtime/src/meet/room-programming-access.ts): the room applies programming.access.set only for room admins, on its own token. programming.read returns the caller’s capabilities. The shared run receipt (programming.run) needs run permission.
  • Meet API (packages/meet-core/src/features/call/server/programming*.ts): join tickets carry owner for the host, editor for people allowed to edit, and viewer for everyone else. Run, stop and problem tests return 403 PROGRAMMING_RUN_FORBIDDEN without run permission, and compile checks return 403 PROGRAMMING_EDIT_FORBIDDEN without edit permission. If a room answers without capabilities, only the host keeps edit and run.
  • Code room (apps/meet-realtime/src/collaboration-access.ts): a viewer’s document update is never applied or relayed. The room answers rejected and the browser rebuilds its document from the room. On a revocation the Meet API pushes a signed /collaboration/access request. That request drops the revoked editors’ sockets to viewer at once and sets whether viewer cursors are relayed. The push carries the policy revision, and the room ignores one older than the last revision it applied. It also records when each editor was revoked. An editor ticket issued before that time acts as viewer, so a cached ticket cannot regain edit during its 60-second lifetime. Seed and join tickets carry the cursor switch and its revision, so a new or reseeded code room starts with the current policy. When a co-host loses room admin, a room admin’s browser asks the room to re-check that person. The room reports them revoked only when they no longer hold edit. If a push fails, the 60-second ticket expiry bounds the revocation. A push is one bounded request per change and starts no runner work. Permission changes are limited to 60 per actor per minute and raised hands to 10.

Deployment

Deploy apps/meet-realtime together with the Meet app, or before it. Meet tickets carry new optional fields (iat, viewerCursors, accessRevision), and an older code-room Worker rejects them. An older Meet app with a newer Worker keeps working: its tickets omit the fields, and its rooms fall back to the host-only default. A policy push without a revision is read as revision 0; it still demotes the editors it lists but cannot override a newer cursor switch.

Participant tools

The strip above the code shows the person’s role badge (Admin, Editor or Viewer) and who is editing. It also holds Follow host (keeps the host’s file and cursor line in view), run history for the session, text size, and Ask to edit. Start fresh asks for confirmation before it replaces the room’s code with the language’s starter code.

Regression coverage

  • packages/realtime/src/meet/room-programming-access.test.ts: defaults, live grant and revoke, take back control, non-admin refusal, and the raise-hand flow.
  • packages/meet-core/src/features/call/server/programming-access.test.ts: rejected runs, stops, tests and checks; viewer and editor tickets; fail-closed older rooms; and the live push.
  • apps/meet-realtime/src/collaboration-access.test.ts: socket downgrade, forged pushes, and viewer cursor stripping.
  • packages/meet-core/src/features/call/components/programming-access-ui.test.tsx: badges, raise hand, the Permissions popover, the live grant, the request toast and the view-only hint.