From 9b97af0d03a9f8fff2c6d57245990b4e30f56b44 Mon Sep 17 00:00:00 2001 From: Narciso Date: Thu, 22 Oct 2026 15:51:23 -0400 Subject: [PATCH] fix(deployment): restrict server deployment history to accessible servers --- apps/dokploy/server/api/routers/deployment.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/server/api/routers/deployment.ts b/apps/dokploy/server/api/routers/deployment.ts index 7926a22b2..f2b47097d 100644 --- a/apps/dokploy/server/api/routers/deployment.ts +++ b/apps/dokploy/server/api/routers/deployment.ts @@ -10,6 +10,7 @@ import { findPreviewDeploymentById, findScheduleById, findVolumeBackupById, + getAccessibleServerIds, IS_CLOUD, removeDeployment, resolveServicePath, @@ -150,8 +151,8 @@ export const deploymentRouter = createTRPCRouter({ } } } else if (input.type === "server") { - const targetServer = await findServerById(input.id); - if (targetServer.organizationId !== ctx.session.activeOrganizationId) { + const accessibleServerIds = await getAccessibleServerIds(ctx.session); + if (!accessibleServerIds.has(input.id)) { throw new TRPCError({ code: "UNAUTHORIZED", message: "You don't have access to this server.",