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 行删除
@@ -5,6 +5,18 @@ const {
} = require("../../../src/constants/permissions");
describe("Permission Constants", () => {
it("separates full AP reading from payment review and preserves multi-role grants", () => {
for (const role of ["ceo", "finance", "finance_mgr"]) {
expect(hasPermission(resolvePermissionsForRoles([role]), "finance.ledger.view")).toBe(true);
}
for (const role of ["manager", "employee", "system_admin", "hr", "administration"]) {
expect(hasPermission(resolvePermissionsForRoles([role]), "finance.ledger.view")).toBe(false);
}
expect(hasPermission(resolvePermissionsForRoles(["manager", "finance"]), "finance.ledger.view")).toBe(true);
expect(hasPermission(resolvePermissionsForRoles(["manager"]), "payment.batch.review")).toBe(true);
expect(hasPermission(resolvePermissionsForRoles(["ceo"]), "payment.batch.manage")).toBe(false);
});
it("grants leave self-service permissions to employee roles", () => {
const employeePermissions = resolvePermissionsForRoles(["employee"]);