fix(deployment): restrict server deployment history to accessible servers

This commit is contained in:
Narciso
2026-10-22 15:51:23 -04:00
parent b3cd3c5061
commit 9b97af0d03
@@ -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.",