This commit is contained in:
greeneclipse committed 2026-10-14 16:13:51 +02:00
1 parent 7ab7acd533
commit 176b1fe47f
18 files changed
+423 -31

No files matched your search

@@ -0,0 +1,21 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { canManageApiKeys } from "./api-key-permissions.ts";
describe("API key management permissions", () => {
it("allows a non-admin with both API Keys and API access", () => {
assert.equal(canManageApiKeys(false, true, true), true);
});
it("rejects a non-admin without the API Keys permission", () => {
assert.equal(canManageApiKeys(false, false, true), false);
});
it("rejects a non-admin without the company API entitlement", () => {
assert.equal(canManageApiKeys(false, true, false), false);
});
it("keeps preexisting company-admin UI access", () => {
assert.equal(canManageApiKeys(true, false, false), true);
});
});