Step 12 - sharing

1 min czytania

Build guest access and sharing.

  • ensureSignedIn() on board entry: await auth.whenReady() FIRST, and only if there is still no user, signInAnonymously(). (Signing in anonymously before the restore completes would overwrite a real logged-in session - this ordering is mandatory.)
  • Share panel (top bar button): full board link, the short join code in large type, and a QR code of the link (small dependency-free QR component). Copy-to-clipboard buttons.
  • Edit lock (editLocked on the board doc, toggled by the owner/teacher): when true, anonymous users cannot modify the board. * Client: block every content-creating/modifying tool at pointerdown for guests (pan, select and laser stay allowed) and show a throttled toast at most every few seconds, not per event. * Server: already enforced by the elements rule from prompt 02 - verify with the emulator that an anonymous write is rejected while editLocked is true and accepted when false.
  • Roles: the board owner and org members are "teachers" on this board (isTeacher flag in presence); teachers see facilitation controls (arriving next prompt), guests do not.

Acceptance: an incognito window joins via QR/link/code without any login screen, can edit when unlocked, is blocked client- AND server-side when locked, and can rename itself.

Dyskusja

Komentarze: 0

Brak komentarzy. Rozpocznij dyskusję.