feat: enhance task persistence and implement centralized kanban board
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user