feat(P17A-1,P17A-2): 新增采购模型权限与系统种子

这个提交包含在:
2026-03-07 20:59:28 +08:00
父节点 9de1169d78
当前提交 1cd4290b4d
共修改 8 个文件,包含 354 行新增和 18 行删除
+21 -1
查看文件
@@ -16,6 +16,12 @@ const LEAVE_SELF_SERVICE_PERMISSIONS = [
"leave.submit",
] as const;
const PROCUREMENT_SELF_SERVICE_PERMISSIONS = [
"procurement.create",
"procurement.view_own",
"procurement.submit",
] as const;
const MASTERDATA_VIEW_PERMISSIONS = ["masterdata.view"] as const;
const MASTERDATA_MANAGE_PERMISSIONS = ["masterdata.manage"] as const;
@@ -25,25 +31,34 @@ const EMPLOYEE_BASE_PERMISSIONS = [
] as const;
const ROLE_PERMISSIONS: Record<string, readonly string[]> = {
employee: EMPLOYEE_BASE_PERMISSIONS,
employee: [
...EMPLOYEE_BASE_PERMISSIONS,
...PROCUREMENT_SELF_SERVICE_PERMISSIONS,
],
manager: [
...EMPLOYEE_BASE_PERMISSIONS,
...PROCUREMENT_SELF_SERVICE_PERMISSIONS,
"expense.approve",
"expense.transfer",
"expense.view_all",
"leave.approve",
"procurement.approve",
"procurement.view_all",
"report.dashboard.view",
"budget.view",
"budget.manage",
],
ceo: [
...EMPLOYEE_BASE_PERMISSIONS,
...PROCUREMENT_SELF_SERVICE_PERMISSIONS,
...MASTERDATA_VIEW_PERMISSIONS,
"expense.approve",
"expense.transfer",
"expense.view_all",
"leave.approve",
"leave.view_all",
"procurement.approve",
"procurement.view_all",
"report.dashboard.view",
"budget.view",
],
@@ -57,6 +72,7 @@ const ROLE_PERMISSIONS: Record<string, readonly string[]> = {
"expense.approve",
"expense.finance.pay",
"expense.view_all",
"procurement.view_all",
],
finance_mgr: [
...EMPLOYEE_BASE_PERMISSIONS,
@@ -72,12 +88,16 @@ const ROLE_PERMISSIONS: Record<string, readonly string[]> = {
"expense.finance.pay",
"expense.view_all",
"expense.finance.override_duplicate",
"procurement.view_all",
"procurement.manage",
"system.settings",
"system.audit.view",
],
administration: [
"expense.proxy_submit",
...EMPLOYEE_BASE_PERMISSIONS,
"procurement.view_all",
"procurement.manage",
],
hr: [
...LEAVE_SELF_SERVICE_PERMISSIONS,