fix: 用专用权限收窄经理 AP 访问(09-07-manager-ap-access-scope)
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s

这个提交包含在:
2026-09-08 07:21:37 +08:00
父节点 99167127b5
当前提交 58dcee08f7
共修改 18 个文件,包含 410 行新增和 8 行删除
@@ -55,6 +55,19 @@ function buildConfig() {
}
describe("workspace small-team navigation defaults", () => {
it.each(["manager", "ceo", "finance", "finance_mgr", "system_admin"])("projects AP separately from payment navigation for %s", async (role) => {
const employee = { id: "synthetic-actor", roleCodes: [role], permissionCodes: resolvePermissionsForRoles([role]) };
const navigation = await getSystemNavigation({
prisma: buildPrisma(["payment_batch_v1"]),
config: { ...buildConfig(), paymentBatchEnabled: true },
employee,
hasPermission: (candidate, permission) => hasPermission(candidate.permissionCodes, permission),
});
const keys = Object.values(navigation.sections).flat().map((item) => item.key);
expect(keys.includes("apOperations")).toBe(["ceo", "finance", "finance_mgr"].includes(role));
if (role === "manager") expect(keys).toContain("paymentBatches");
});
it("keeps only the small-team task path in default main navigation", () => {
const mainModules = Object.entries(DEFAULT_MODULE_VISIBILITY)
.filter(([, placement]) => placement === "main")
@@ -224,7 +237,7 @@ describe("workspace small-team navigation defaults", () => {
const mainLabels = navigation.sections.main.map((item) => item.label);
expect(mainLabels).toContain("付款");
expect(mainLabels).toContain("应付账款");
expect(mainLabels).not.toContain("应付账款");
expect(mainLabels).not.toContain("票据");
});
});