mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix: some bugs
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user