fix: some bugs

This commit is contained in:
charles-gauthereau
2026-05-28 20:12:59 +02:00
parent c3bafef6d8
commit 47d3059d78
4 changed files with 28 additions and 14 deletions
+10
View File
@@ -69,6 +69,16 @@ export const POST = withApiKey(
);
}
const canCreateGlobalAgent =
ctx.user.permissions.isAdmin || ctx.user.permissions.isSuperAdmin;
if (!organizationId && !canCreateGlobalAgent) {
return NextResponse.json(
{ error: "Forbidden" },
{ status: 403 }
);
}
const createdAgent = await createAgentService({
organizationId,
data: {