feat: Add team lead authorization for project deletion and implement delete confirmation modal in edit project page

This commit is contained in:
2026-01-22 19:33:37 +01:00
parent daea67fddb
commit 6dfb0224ab
3 changed files with 188 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ import { logFieldChange } from "@/lib/queries/fieldHistory";
import { addNoteToProject } from "@/lib/queries/notes";
import initializeDatabase from "@/lib/init-db";
import { NextResponse } from "next/server";
import { withReadAuth, withUserAuth } from "@/lib/middleware/auth";
import { withReadAuth, withUserAuth, withTeamLeadAuth } from "@/lib/middleware/auth";
import {
logApiActionSafe,
AUDIT_ACTIONS,
@@ -155,4 +155,4 @@ async function deleteProjectHandler(req, { params }) {
// Protected routes - require authentication
export const GET = withReadAuth(getProjectHandler);
export const PUT = withUserAuth(updateProjectHandler);
export const DELETE = withUserAuth(deleteProjectHandler);
export const DELETE = withTeamLeadAuth(deleteProjectHandler);