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 行删除
@@ -217,6 +217,21 @@ async function buildApp(options = {}) {
}
describe("ap operations export route", () => {
it.each(["manager", "ceo", "system_admin"])("does not grant AP export through ledger or reviewer access for %s", async (role) => {
const { resolvePermissionsForRoles } = require("../../../src/constants/permissions");
const { app, paymentBatchFindMany, auditCreate } = await buildApp({
actor: { id: ACTOR_ID, permissionCodes: resolvePermissionsForRoles([role]) },
});
try {
const response = await app.inject({ method: "POST", url: "/api/exports/ap-operations", payload: { format: "csv" } });
expect(response.statusCode).toBe(403);
expect(paymentBatchFindMany).not.toHaveBeenCalled();
expect(auditCreate).not.toHaveBeenCalled();
} finally {
await app.close();
}
});
it("exports ap operations as csv with section blocks and filters", async () => {
const {
app,