From 1cadafea0e03b8996dd51ec3f2f2984633d3ef3d Mon Sep 17 00:00:00 2001 From: kjs Date: Mon, 22 Dec 2025 09:53:22 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=B5=EC=82=AC=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend-node/src/services/menuCopyService.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/backend-node/src/services/menuCopyService.ts b/backend-node/src/services/menuCopyService.ts index 2ba39c2f..eb230454 100644 --- a/backend-node/src/services/menuCopyService.ts +++ b/backend-node/src/services/menuCopyService.ts @@ -2449,10 +2449,19 @@ export class MenuCopyService { // menuIdMap에 없으면 원본 menu_objid가 복사된 메뉴 범위 밖이므로 // scope_type을 'table'로 변경하거나, 매핑이 없으면 null 처리 const finalMenuObjid = newMenuObjid !== undefined ? newMenuObjid : null; - const finalScopeType = - r.scope_type === "menu" && finalMenuObjid === null - ? "table" // 메뉴 매핑이 없으면 table 스코프로 변경 - : r.scope_type; + // scope_type 결정 로직: + // 1. menu 스코프인데 menu_objid 매핑이 없는 경우 + // - table_name이 있으면 'table' 스코프로 변경 + // - table_name이 없으면 'global' 스코프로 변경 + // 2. 그 외에는 원본 scope_type 유지 + let finalScopeType = r.scope_type; + if (r.scope_type === "menu" && finalMenuObjid === null) { + if (r.table_name) { + finalScopeType = "table"; // table_name이 있으면 table 스코프 + } else { + finalScopeType = "global"; // table_name도 없으면 global 스코프 + } + } return [ r.newRuleId,