From d7d55e990836f82ef7de91af02ae2f3a3a02b71b Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Tue, 3 Mar 2026 16:46:14 +0800 Subject: [PATCH] chore(seed): include customer analysis permission mapping --- deploy/postgres/seed_tenant_customer_permissions.sql | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deploy/postgres/seed_tenant_customer_permissions.sql b/deploy/postgres/seed_tenant_customer_permissions.sql index 96bfc9c..ed7a886 100644 --- a/deploy/postgres/seed_tenant_customer_permissions.sql +++ b/deploy/postgres/seed_tenant_customer_permissions.sql @@ -124,12 +124,13 @@ WHERE "Portal" = 1 AND ("Name" = 'CustomerAnalysis' OR "Component" = '/customer/analysis/index'); --- 3) 给角色模板补齐客户列表与画像权限(按订单列表权限映射) --- 说明:本轮映射 list(view/manage)+profile(view),analysis 不做角色映射。 +-- 3) 给角色模板补齐客户管理权限(按订单列表权限映射) +-- 说明:本轮映射 list(view/manage)+profile(view)+analysis(view)。 WITH code_mapping(source_code, target_code) AS ( VALUES ('tenant:order:list:view', 'tenant:customer:list:view'), ('tenant:order:list:view', 'tenant:customer:profile:view'), + ('tenant:order:list:view', 'tenant:customer:analysis:view'), ('tenant:order:list:update', 'tenant:customer:list:manage') ), candidates AS ( @@ -180,6 +181,7 @@ WITH code_mapping(source_code, target_code) AS ( VALUES ('tenant:order:list:view', 'tenant:customer:list:view'), ('tenant:order:list:view', 'tenant:customer:profile:view'), + ('tenant:order:list:view', 'tenant:customer:analysis:view'), ('tenant:order:list:update', 'tenant:customer:list:manage') ) UPDATE public.role_template_permissions target @@ -194,12 +196,13 @@ WHERE source."RoleTemplateId" = target."RoleTemplateId" AND target."PermissionCode" = mapping.target_code; --- 4) 给租户角色补齐客户列表与画像权限(按订单列表权限映射) --- 说明:本轮映射 list(view/manage)+profile(view),analysis 不做角色映射。 +-- 4) 给租户角色补齐客户管理权限(按订单列表权限映射) +-- 说明:本轮映射 list(view/manage)+profile(view)+analysis(view)。 WITH code_mapping(source_code, target_code) AS ( VALUES ('tenant:order:list:view', 'tenant:customer:list:view'), ('tenant:order:list:view', 'tenant:customer:profile:view'), + ('tenant:order:list:view', 'tenant:customer:analysis:view'), ('tenant:order:list:update', 'tenant:customer:list:manage') ), source_rows AS ( @@ -274,6 +277,7 @@ WITH code_mapping(source_code, target_code) AS ( VALUES ('tenant:order:list:view', 'tenant:customer:list:view'), ('tenant:order:list:view', 'tenant:customer:profile:view'), + ('tenant:order:list:view', 'tenant:customer:analysis:view'), ('tenant:order:list:update', 'tenant:customer:list:manage') ) UPDATE public.role_permissions target