mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-10-23 08:55:25 +00:00
fix(deployment): restrict server deployment history to accessible servers
This commit is contained in:
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user