feat: enhance task persistence and implement centralized kanban board

This commit is contained in:
2026-04-28 21:55:37 +05:00
parent 7da3fc8ff4
commit 1f87f0d6e9
9 changed files with 425 additions and 45 deletions
+6 -1
View File
@@ -10,7 +10,12 @@ export default defineEventHandler(async (event) => {
const existing = await prisma.canvas.findUnique({ where: { id } })
if (!existing) throw createError({ statusCode: 404, message: 'Canvas not found' })
if (existing.ownerId !== user.id) throw createError({ statusCode: 403, message: 'Access denied' })
// Allow if owner, or if admin, or if canvas is public (for collaborative editing)
if (existing.ownerId !== user.id && user.role !== 'admin' && !existing.isPublic) {
console.log('[DEBUG 403]', { ownerId: existing.ownerId, userId: user.id, userRole: user.role, isPublic: existing.isPublic })
throw createError({ statusCode: 403, message: 'Access denied' })
}
const { name, nodes, edges, isPublic, groupId } = body
const canvas = await prisma.canvas.update({