Merge pull request 'fix(멀티테넌시): 테넌트 사이트 관리자 메뉴에서 솔루션 전용 메뉴 차단' (#21) from johngreen into main
Build & Deploy to K8s / build-and-deploy (push) Successful in 8m3s

This commit is contained in:
2026-05-15 18:36:42 +09:00
3 changed files with 26 additions and 2 deletions
@@ -32,13 +32,17 @@ public class AdminController {
@RequestAttribute("company_code") String companyCode, @RequestAttribute("company_code") String companyCode,
@RequestAttribute("role") String role, @RequestAttribute("role") String role,
@RequestAttribute("user_id") String userId, @RequestAttribute("user_id") String userId,
@RequestParam Map<String, Object> params) { @RequestParam Map<String, Object> params,
HttpServletRequest request) {
params.put("company_code", companyCode); params.put("company_code", companyCode);
params.put("user_type", role); params.put("user_type", role);
params.put("user_id", userId); params.put("user_id", userId);
params.putIfAbsent("user_lang", "ko"); params.putIfAbsent("user_lang", "ko");
params.put("is_management_screen", params.put("is_management_screen",
params.get("menu_type") == null || "true".equals(params.get("include_inactive"))); params.get("menu_type") == null || "true".equals(params.get("include_inactive")));
// 관리 호스트(solution.invyone.com 등) 여부 — 테넌트 호스트이면 IS_SOLUTION_ONLY 메뉴를 SQL 단계에서 제외
String host = request.getHeader("Host");
params.put("is_management_host", !SuperAdminGuard.isTenantHost(host));
return ResponseEntity.ok(ApiResponse.success(adminService.getAdminMenuList(params), "관리자 메뉴 목록 조회 성공")); return ResponseEntity.ok(ApiResponse.success(adminService.getAdminMenuList(params), "관리자 메뉴 목록 조회 성공"));
} }
@@ -209,7 +209,21 @@ public class StartupSchemaMigrator {
// 솔루션 관리 호스트(solution.invyone.com 등) 에서만 노출되는 메뉴 플래그. // 솔루션 관리 호스트(solution.invyone.com 등) 에서만 노출되는 메뉴 플래그.
// 테넌트 사이트에선 mapper SQL 단계에서 제외. 메타 DB 는 Flyway V023 으로도 적용되지만 // 테넌트 사이트에선 mapper SQL 단계에서 제외. 메타 DB 는 Flyway V023 으로도 적용되지만
// 프로비저닝된 테넌트 DB 는 부팅 때 동기화. // 프로비저닝된 테넌트 DB 는 부팅 때 동기화.
"ALTER TABLE MENU_INFO ADD COLUMN IF NOT EXISTS IS_SOLUTION_ONLY BOOLEAN DEFAULT FALSE NOT NULL" "ALTER TABLE MENU_INFO ADD COLUMN IF NOT EXISTS IS_SOLUTION_ONLY BOOLEAN DEFAULT FALSE NOT NULL",
// V023 데이터 동기화: 솔루션 전용 메뉴 마킹.
// 회사관리 / 회사 프로비저닝 / 감사로그는 관리 호스트에서만 노출돼야 함.
// 이미 TRUE 인 행은 그대로 두기 위해 false 인 행만 갱신.
"""
UPDATE MENU_INFO
SET IS_SOLUTION_ONLY = TRUE
WHERE IS_SOLUTION_ONLY = FALSE
AND MENU_URL IN (
'/admin/sysMng/subdomainList',
'/admin/userMng/companyList',
'/admin/audit-log'
)
"""
); );
@EventListener(ApplicationReadyEvent.class) @EventListener(ApplicationReadyEvent.class)
@@ -58,6 +58,9 @@
AND RMA.READ_YN = 'Y' AND RMA.READ_YN = 'Y'
) )
</if> </if>
<if test='is_management_host == false'>
AND MENU.IS_SOLUTION_ONLY = FALSE
</if>
UNION ALL UNION ALL
@@ -105,6 +108,9 @@
AND RMA.READ_YN = 'Y' AND RMA.READ_YN = 'Y'
) )
</if> </if>
<if test='is_management_host == false'>
AND S.IS_SOLUTION_ONLY = FALSE
</if>
) )
SELECT SELECT
V.LEV V.LEV