Project format updates

This commit is contained in:
Sander Grootendorst
2026-12-01 14:58:50 +01:00
parent 8d0a531084
commit 9339b7a131
17 changed files with 707 additions and 134 deletions
+17 -1
View File
@@ -1,6 +1,22 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {createSharedFolderReader} from '../src/shared-folder.js';
import {createSharedFolderReader, openWorkspaceAsset} from '../src/shared-folder.js';
test('opening a workspace asset rejects cross-group, cross-asset and overprivileged replies', async () => {
const scope = {workspaceId: 'company', groupId: 'estimators'};
const grant = {...scope, asset: 'suppliers', folderId: 'folder-1', path: '/shared/suppliers', canWrite: false};
const open = reply => openWorkspaceAsset({scope, asset: 'suppliers', access: 'read', bridge: {
async invoke(command, args) {
assert.equal(command, 'filesystem_open_workspace_asset');
assert.deepEqual(args, {asset: 'suppliers', access: 'read'});
return reply;
}
}});
assert.deepEqual(await open(grant), grant);
for (const patch of [{groupId:'other'}, {asset:'prices'}, {path:'/shared'}, {canWrite:true}]) {
await assert.rejects(open({...grant, ...patch}), /Invalid workspace asset grant/);
}
});
test('specialist and other viewers read the same existing supplier register and price book', async () => {
const root='/Shared/Registers';