fix: authorize super admins by dynamic highest rank

This commit is contained in:
simoleo89
2026-07-11 22:35:40 +02:00
parent bb847176ad
commit f08e56cf53
10 changed files with 173 additions and 65 deletions
@@ -0,0 +1,11 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
describe("authorization source contract", () => {
it("contains no fixed numeric rank threshold in central authorization files", () => {
for (const file of ["src/lib/permissions.ts", "src/lib/proxy-access.ts", "src/lib/admin/guard.ts"]) {
const source = readFileSync(file, "utf8");
expect(source, file).not.toMatch(/rank\s*[<>]=?\s*\d+/i);
}
});
});