canvas-website/src
Jeff Emmett 9d513e37bd feat: implement user permissions system (view/edit/admin)
Phase 1 of user permissions feature:
- Add board permissions schema to D1 database
  - boards table with owner, default_permission, is_public
  - board_permissions table for per-user permissions
- Add permission types (PermissionLevel) to worker and client
- Implement permission API handlers in worker/boardPermissions.ts
  - GET /boards/:boardId/permission - check user's permission
  - GET /boards/:boardId/permissions - list all (admin only)
  - POST /boards/:boardId/permissions - grant permission (admin)
  - DELETE /boards/:boardId/permissions/:userId - revoke (admin)
  - PATCH /boards/:boardId - update board settings (admin)
- Update AuthContext with permission fetching and caching
  - fetchBoardPermission() - fetch and cache permission for a board
  - canEdit() - check if user can edit current board
  - isAdmin() - check if user is admin for current board
- Create AnonymousViewerBanner component with CryptID signup prompt
- Add CSS styles for anonymous viewer banner
- Fix automerge sync manager to flush saves on peer disconnect

Permission levels:
- view: Read-only, cannot create/edit/delete shapes
- edit: Can modify board contents
- admin: Full access + permission management

Next steps:
- Integrate with Board component for read-only mode
- Wire up permission checking in Automerge sync
- Add permission management UI for admins

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-05 22:27:12 -08:00
..
automerge chore: exclude open-mapping from build, fix TypeScript errors 2025-12-05 12:16:29 -08:00
collections implemented collections and graph layout tool 2025-07-29 14:52:57 -04:00
components feat: implement user permissions system (view/edit/admin) 2025-12-05 22:27:12 -08:00
config automerge, obsidian/quartz, transcribe attempt, fix AI APIs 2025-09-21 11:43:06 +02:00
constants final update fix old data conversion 2025-11-10 15:38:53 -08:00
context feat: implement user permissions system (view/edit/admin) 2025-12-05 22:27:12 -08:00
css feat: implement user permissions system (view/edit/admin) 2025-12-05 22:27:12 -08:00
graph automerge, obsidian/quartz, transcribe attempt, fix AI APIs 2025-09-21 11:43:06 +02:00
hooks feat: Add GoogleItemShape with privacy badges (Phase 4) 2025-12-04 17:52:54 -08:00
lib feat: implement user permissions system (view/edit/admin) 2025-12-05 22:27:12 -08:00
open-mapping chore: add D1 database ID and refactor MapShape 2025-12-04 21:32:46 -08:00
propagators feat: fix Holon shape H3 validation + offline persistence + geometry error handling 2025-11-29 21:36:02 -08:00
public feat: update mulTmux terminal tool and improve shape utilities 2025-11-26 04:08:08 -08:00
routes Merge feature/open-mapping: Automerge CRDT sync and open-mapping module 2025-12-04 19:48:38 -08:00
shapes chore: exclude open-mapping from build, fix TypeScript errors 2025-12-05 12:16:29 -08:00
slides slidedeck shape installed, still minor difficulty in keyboard arrow transition between slides (last slide + wraparound) 2025-01-23 14:14:04 +01:00
tools Merge feature/open-mapping: Automerge CRDT sync and open-mapping module 2025-12-04 19:48:38 -08:00
types refactor: remove OddJS dependency and fix Automerge sync 2025-11-16 20:19:02 -07:00
ui chore: exclude open-mapping from build, fix TypeScript errors 2025-12-05 12:16:29 -08:00
utils feat: add custom system prompt support to LLM utility 2025-12-04 03:16:13 -08:00
App.tsx Merge origin/main into feature/google-export 2025-12-04 16:29:34 -08:00
CmdK.tsx feat: fix Holon shape H3 validation + offline persistence + geometry error handling 2025-11-29 21:36:02 -08:00
GestureTool.ts everything working in dev 2025-11-10 11:06:13 -08:00
default_gestures.ts automerge, obsidian/quartz, transcribe attempt, fix AI APIs 2025-09-21 11:43:06 +02:00
gestures.ts add in gestures and ctrl+space command tool (TBD add global LLM) 2025-07-29 16:02:51 -04:00
prompt.ts everything working in dev 2025-11-10 11:06:13 -08:00
snapshot.json everything working in dev 2025-11-10 11:06:13 -08:00
ui.tsx everything working in dev 2025-11-10 11:06:13 -08:00
vite-env.d.ts chore: exclude open-mapping from build, fix TypeScript errors 2025-12-05 12:16:29 -08:00