Skip to content

[feat] viewer object permissions + local-only objects - #50

Merged
AlexZ005 merged 2 commits into
mainfrom
feature/viewer-object-permissions
Jul 25, 2026
Merged

[feat] viewer object permissions + local-only objects#50
AlexZ005 merged 2 commits into
mainfrom
feature/viewer-object-permissions

Conversation

@AlexZ005

Copy link
Copy Markdown
Collaborator

Implements the roadmap (docs/plans-core/roadmap-viewer-object-permissions.md). Active only when the cloud plugin publishes roles — OSS build byte-unchanged.

  • objectPermissions.js: canEditObject (viewer edits only their own __localOnly objects), mark/clear, gateCreationBroadcast, warnings.
  • V-1 gizmo gate: a viewer can select/inspect a shared object but the transform gizmo won't attach (toast explains).
  • V-2 local-only creations: PeerConnection.send marks a viewer's object creations __localOnly, warns, and skips the broadcast; sendObject handshake filters them out too.
  • V-3/V-4 LocalObjects.svelte: a 'Local objects' section (drop-in / Remove / Share + Share all once you're an editor); main list hides local-only.

svelte-check 485/72 (baseline). Boots clean, no cycle. Two-peer viewer flow = manual check.

Only active when the cloud plugin publishes roles (rolesInfo); the OSS build is
byte-unchanged (no plugin -> no gating, Local-objects section hidden).

- objectPermissions.js: role-aware helpers — isViewer / canEditObject (viewer may edit
  ONLY their own `__localOnly` objects; editor/admin edit anything) / markLocalOnly /
  clearLocalOnly / gateCreationBroadcast + throttled warnings.
- V-1 gizmo gate (objectActions.applySelectionSet): a viewer can still SELECT/inspect a
  shared object, but the move/rotate/scale gizmo won't attach unless the whole set is
  editable by them; a throttled "view-only" toast explains.
- V-2 local-only creations: PeerConnection.send now runs gateCreationBroadcast — when a
  viewer broadcasts an object CREATION (create/light/group/object/objectfile/duplicate)
  it marks the object `__localOnly`, warns, and SKIPS the broadcast (peers dropped it
  anyway via the receive-side capability gate). sendObject (handshake) also filters
  `__localOnly` so a viewer's WIP never syncs to late joiners. `__localOnly` rides the
  toJSON/GLTF-extras round-trip like the existing `__uuid` marker.
- V-3/V-4 LocalObjects.svelte: a collapsible "Local objects" section at the top of the
  object list (Controls) — lists `__localOnly` objects, a drop target to mark objects
  local-only, Remove, and (once you have edit access) Share / Share all which broadcasts
  the object + clears the flag. The main list filters `__localOnly` out.

svelte-check 485/72 (baseline held). Boots clean (no import cycle); OSS unchanged.
Two-peer viewer flow (create -> local-only -> promote -> share) = manual check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AlexZ005
AlexZ005 merged commit bf25631 into main Jul 25, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AlexZ005
AlexZ005 deleted the feature/viewer-object-permissions branch August 5, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant