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> |
||
|---|---|---|
| .. | ||
| AuthContext.tsx | ||
| AutomergeHandleContext.tsx | ||
| FileSystemContext.tsx | ||
| NotificationContext.tsx | ||