12 lines
594 B
JavaScript
12 lines
594 B
JavaScript
import { test } from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { leafAllowed, loadPolicy } from '../src/policy.js';
|
|
|
|
test('leaf may archive and jobs, never billing', () => {
|
|
assert.equal(leafAllowed('verae.archive.put'), true);
|
|
assert.equal(leafAllowed('verae.archive.reply.abc'), true);
|
|
assert.equal(leafAllowed('verae.zapier.jobs.watch'), true);
|
|
assert.equal(leafAllowed('verae.billing.balance.adjust'), false);
|
|
assert.equal(leafAllowed('verae.billing.statement.get'), false);
|
|
assert.ok(loadPolicy().accounts.LEAF.deny_publish.includes('verae.billing.>'));
|
|
});
|