diff --git a/app/api/admin/security-monitoring/threat-analysis/route.ts b/app/api/admin/security-monitoring/threat-analysis/route.ts index 2425817..6327de5 100644 --- a/app/api/admin/security-monitoring/threat-analysis/route.ts +++ b/app/api/admin/security-monitoring/threat-analysis/route.ts @@ -29,7 +29,7 @@ export async function POST(request: NextRequest) { try { const session = await getServerSession(authOptions); - if (!session?.user || !session.user.isPlatformUser) { + if (!session?.user || session.user.role !== "ADMIN") { return NextResponse.json({ error: "Unauthorized" }, { status: 401 }); } diff --git a/components/security/SecurityAlertsTable.tsx b/components/security/SecurityAlertsTable.tsx index 576d7da..e8b14b3 100644 --- a/components/security/SecurityAlertsTable.tsx +++ b/components/security/SecurityAlertsTable.tsx @@ -4,7 +4,15 @@ import { AlertTriangle, CheckCircle, Eye, EyeOff } from "lucide-react"; import { useState } from "react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Card, CardContent } from "@/components/ui/card"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; import { Table, TableBody, @@ -196,32 +204,32 @@ export function SecurityAlertsTable({ )} {/* Alert Details Modal */} - {selectedAlert && ( - - - - - - {selectedAlert.title} - - - {selectedAlert.severity} - - - {formatAlertType(selectedAlert.type)} - - - - setSelectedAlert(null)} + setSelectedAlert(null)} + > + + + + {selectedAlert?.title} + + - Close - + {selectedAlert?.severity} + + + {formatAlertType(selectedAlert?.type || "")} + - - + + + Security alert details and context information + + + + {selectedAlert && ( + Description @@ -249,26 +257,28 @@ export function SecurityAlertsTable({ )} + + )} - - - {formatTimestamp(selectedAlert.timestamp)} - - {!selectedAlert.acknowledged && ( - { - onAcknowledge(selectedAlert.id); - setSelectedAlert(null); - }} - > - Acknowledge Alert - - )} - - - - - )} + + + {selectedAlert && formatTimestamp(selectedAlert.timestamp)} + + + {selectedAlert && !selectedAlert.acknowledged && ( + { + onAcknowledge(selectedAlert.id); + setSelectedAlert(null); + }} + > + Acknowledge Alert + + )} + + + + ); }
@@ -249,26 +257,28 @@ export function SecurityAlertsTable({