@powerhousedao/powerhouse-vetra-packages 6.2.2-dev.49 → 6.2.2-dev.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/assets/{entry-C2ClkbVN.js → entry-CSmPhBmp.js} +2 -2
- package/dist/browser/assets/{projection-entry-S39DdeT-.js → projection-entry-CVK7H2AN.js} +3 -3
- package/dist/browser/{connect-70_1bgIZ.js → connect-C104dWjH.js} +4 -4
- package/dist/browser/{connect-70_1bgIZ.js.map → connect-C104dWjH.js.map} +1 -1
- package/dist/browser/{dist-CXIjN0Ex.js → dist-DX9iadhH.js} +3 -3
- package/dist/browser/{dist-CXIjN0Ex.js.map → dist-DX9iadhH.js.map} +1 -1
- package/dist/browser/{document-drive-PYPIaEvw.js → document-drive-CJz0STcj.js} +31 -6
- package/dist/browser/document-drive-CJz0STcj.js.map +1 -0
- package/dist/browser/document-models/index.js +1 -1
- package/dist/browser/{editor-QW6D3wl8.js → editor-IvqnagPG.js} +6 -6
- package/dist/browser/{editor-QW6D3wl8.js.map → editor-IvqnagPG.js.map} +1 -1
- package/dist/browser/{editor-DOJeQKlN.js → editor-X5l1tL2F.js} +5 -5
- package/dist/browser/{editor-DOJeQKlN.js.map → editor-X5l1tL2F.js.map} +1 -1
- package/dist/browser/editors/document-model-editor/module.js +1 -1
- package/dist/browser/editors/generic-drive-explorer/index.js +4 -4
- package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
- package/dist/browser/{folder-view-VM5cJbvv.js → folder-view-CRb23VC6.js} +3 -3
- package/dist/browser/{folder-view-VM5cJbvv.js.map → folder-view-CRb23VC6.js.map} +1 -1
- package/dist/browser/{graphql-editor-CjpiNMV0.js → graphql-editor-WUel_gv1.js} +3 -3
- package/dist/browser/{graphql-editor-CjpiNMV0.js.map → graphql-editor-WUel_gv1.js.map} +1 -1
- package/dist/browser/index.js +2 -2
- package/dist/browser/{json-editor-CeIHor4v.js → json-editor-b1VZFbze.js} +3 -3
- package/dist/browser/{json-editor-CeIHor4v.js.map → json-editor-b1VZFbze.js.map} +1 -1
- package/dist/browser/{lib-PZlA5c3e.js → lib-DcVgOOqQ.js} +2 -2
- package/dist/browser/lib-DcVgOOqQ.js.map +1 -0
- package/dist/browser/{state-schemas-CbPirA44.js → state-schemas-BuSO5vf_.js} +3 -3
- package/dist/browser/{state-schemas-CbPirA44.js.map → state-schemas-BuSO5vf_.js.map} +1 -1
- package/dist/node/{connect-CkBYxX_q.mjs → connect-s4eurJ2e.mjs} +4 -4
- package/dist/node/{connect-CkBYxX_q.mjs.map → connect-s4eurJ2e.mjs.map} +1 -1
- package/dist/node/{dist-CS8QwZwZ.mjs → dist-p5v40GE-.mjs} +3 -3
- package/dist/node/{dist-CS8QwZwZ.mjs.map → dist-p5v40GE-.mjs.map} +1 -1
- package/dist/node/{document-drive-DrBAR9as.mjs → document-drive-BgHPyTwW.mjs} +31 -6
- package/dist/node/document-drive-BgHPyTwW.mjs.map +1 -0
- package/dist/node/document-models/index.mjs +1 -1
- package/dist/node/{editor-Dv22q5WR.mjs → editor-Bi7fPi7g.mjs} +5 -5
- package/dist/node/{editor-Dv22q5WR.mjs.map → editor-Bi7fPi7g.mjs.map} +1 -1
- package/dist/node/{editor-ClZqmnoh.mjs → editor-q-CY2cHO.mjs} +6 -6
- package/dist/node/{editor-ClZqmnoh.mjs.map → editor-q-CY2cHO.mjs.map} +1 -1
- package/dist/node/editors/document-model-editor/module.mjs +1 -1
- package/dist/node/editors/generic-drive-explorer/index.mjs +4 -4
- package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
- package/dist/node/{folder-view-6H-dMp8X.mjs → folder-view-1tKOZNNo.mjs} +3 -3
- package/dist/node/{folder-view-6H-dMp8X.mjs.map → folder-view-1tKOZNNo.mjs.map} +1 -1
- package/dist/node/{graphql-editor-DP0o3W7f.mjs → graphql-editor-Bht1MH0X.mjs} +3 -3
- package/dist/node/{graphql-editor-DP0o3W7f.mjs.map → graphql-editor-Bht1MH0X.mjs.map} +1 -1
- package/dist/node/index.mjs +2 -2
- package/dist/node/{json-editor-CNbnXYz6.mjs → json-editor-1QYpJ-1F.mjs} +3 -3
- package/dist/node/{json-editor-CNbnXYz6.mjs.map → json-editor-1QYpJ-1F.mjs.map} +1 -1
- package/dist/node/{main-aITg389Z.mjs → main-BO1p3AOa.mjs} +2 -2
- package/dist/node/main-BO1p3AOa.mjs.map +1 -0
- package/dist/node/{state-schemas-CylQoH3Q.mjs → state-schemas-C0CiF1-m.mjs} +3 -3
- package/dist/node/{state-schemas-CylQoH3Q.mjs.map → state-schemas-C0CiF1-m.mjs.map} +1 -1
- package/package.json +7 -7
- package/dist/browser/document-drive-PYPIaEvw.js.map +0 -1
- package/dist/browser/lib-PZlA5c3e.js.map +0 -1
- package/dist/node/document-drive-DrBAR9as.mjs.map +0 -1
- package/dist/node/main-aITg389Z.mjs.map +0 -1
|
@@ -4369,10 +4369,35 @@ function evaluateNode(node, subject, request, conditions) {
|
|
|
4369
4369
|
function evaluateCondition(condition, subject, request, conditions) {
|
|
4370
4370
|
return evaluateNode(condition, subject, request, conditions) === true;
|
|
4371
4371
|
}
|
|
4372
|
+
/** Whether a capability's scope reaches the requested one. */
|
|
4373
|
+
function scopeCovers(scope, requested) {
|
|
4374
|
+
return scope === void 0 || scope === "*" || scope === requested;
|
|
4375
|
+
}
|
|
4376
|
+
/**
|
|
4377
|
+
* Whether one grant answers this request.
|
|
4378
|
+
*
|
|
4379
|
+
* A grant allowing execute on a scope also allows reading it: executing an
|
|
4380
|
+
* operation means reading the state it applies to, so permitting the write while
|
|
4381
|
+
* withholding the read would describe an access nobody could use. The converse
|
|
4382
|
+
* does not hold -- a read grant confers no write.
|
|
4383
|
+
*
|
|
4384
|
+
* Only an allow carries across. A deny on execute withholds the write and says
|
|
4385
|
+
* nothing about the read, so a policy locking writes down does not silently
|
|
4386
|
+
* revoke a read grant sitting before it. The operation list is not consulted
|
|
4387
|
+
* either: it restricts which operations may be executed, not whether the scope
|
|
4388
|
+
* is visible, and a read carries no operation to match against.
|
|
4389
|
+
*
|
|
4390
|
+
* Reads are not consensus -- no replica records a read, and the two read call
|
|
4391
|
+
* sites are both inside the read gate -- so this rule is not part of what makes
|
|
4392
|
+
* an operation valid, and does not need a policy version of its own.
|
|
4393
|
+
*/
|
|
4394
|
+
function grantAnswers(grant, request) {
|
|
4395
|
+
if (capabilityCovers(grant.capability, request)) return true;
|
|
4396
|
+
return request.verb === "read" && grant.effect === "allow" && grant.capability.can === "execute" && scopeCovers(grant.capability.scope, request.scope);
|
|
4397
|
+
}
|
|
4372
4398
|
function capabilityCovers(capability, request) {
|
|
4373
4399
|
if (capability.can !== request.verb) return false;
|
|
4374
|
-
|
|
4375
|
-
if (scope !== void 0 && scope !== "*" && scope !== request.scope) return false;
|
|
4400
|
+
if (!scopeCovers(capability.scope, request.scope)) return false;
|
|
4376
4401
|
if (capability.can === "execute") {
|
|
4377
4402
|
if (capability.operation === void 0) return true;
|
|
4378
4403
|
return request.operation !== void 0 && capability.operation.includes(request.operation);
|
|
@@ -4409,7 +4434,7 @@ function evaluateGrantStack(grants, subject, request, groups, conditions) {
|
|
|
4409
4434
|
if (conditions === void 0) continue;
|
|
4410
4435
|
if (!evaluateCondition(grant.where, subject, request, conditions)) continue;
|
|
4411
4436
|
}
|
|
4412
|
-
if (
|
|
4437
|
+
if (grantAnswers(grant, request) && principalMatches(grant.principal, subject, request, groups, conditions)) applicable = grant;
|
|
4413
4438
|
}
|
|
4414
4439
|
if (applicable === void 0) return {
|
|
4415
4440
|
decision: "deny",
|
|
@@ -5545,7 +5570,7 @@ function replayDocument(initialState, operations, reducer, header, dispatch, ski
|
|
|
5545
5570
|
};
|
|
5546
5571
|
let result = document;
|
|
5547
5572
|
if (operationsToReplay.length) result = operationsToReplay.reduce((document, operation) => {
|
|
5548
|
-
if (isDenied(operation)) return appendWithoutApplying(document, operation);
|
|
5573
|
+
if (isDenied(operation)) return updateHeaderRevision(appendWithoutApplying(document, operation), operation.action.scope, operation.timestampUtcMs);
|
|
5549
5574
|
return reducer(document, operation.action, dispatch, {
|
|
5550
5575
|
ignoreSkipOperations: true,
|
|
5551
5576
|
checkHashes,
|
|
@@ -7037,7 +7062,7 @@ function replayDocumentVersioned(initialState, operations, config, header, dispa
|
|
|
7037
7062
|
const segEnd = k < validatedUpgrades.length ? boundaries[k]?.[s] ?? ops.length : ops.length;
|
|
7038
7063
|
const segOps = ops.slice(segStart, segEnd);
|
|
7039
7064
|
for (const op of segOps) {
|
|
7040
|
-
if (isDenied(op)) document = appendWithoutApplying(document, op, s);
|
|
7065
|
+
if (isDenied(op)) document = updateHeaderRevision(appendWithoutApplying(document, op, s), s, op.timestampUtcMs);
|
|
7041
7066
|
else document = reducer(document, op.action, dispatch, {
|
|
7042
7067
|
ignoreSkipOperations: true,
|
|
7043
7068
|
checkHashes,
|
|
@@ -8309,4 +8334,4 @@ const driveDocumentModelModule = {
|
|
|
8309
8334
|
//#endregion
|
|
8310
8335
|
export { setOperationSchema as $, createZip as A, replayDocumentVersioned as B, baseSaveToFileHandle as C, createPresignedHeader as D, createBaseState as E, documentModelDocumentType as F, setModelExtension as G, setAuthorWebsite as H, hashDocumentStateForScope as I, setModuleName as J, setModelId as K, isDocumentAction as L, deleteModule as M, deleteOperation as N, createReducer as O, deleteOperationError as P, setOperationName as Q, redo as R, baseLoadFromInputVersioned as S, createAction as T, setInitialState as U, setAuthorName as V, setModelDescription as W, setOperationDescription as X, setName as Y, setOperationErrorName as Z, addOperationError as _, handleTargetNameCollisions as a, generateId as at, baseCreateDocument as b, isValidName as c, documentModelDocumentModelModule as d, setStateSchema as et, logger as f, addOperation as g, addModule as h, generateNodesCopy as i, validateStateSchemaName as it, defaultBaseState as j, createState as k, moveNode as l, BaseDocumentStateSchema as m, copyNode as n, validateInitialState as nt, isFileNode as o, BaseDocumentHeaderSchema as p, setModelName as q, driveDocumentModelModule as r, validateModules as rt, isFolderNode as s, addFolder as t, undo as tt, updateNode as u, assertAuthPreservedOnDuplicate as v, buildSignedAction as w, baseLoadFromInput as x, baseActions as y, releaseNewVersion as z };
|
|
8311
8336
|
|
|
8312
|
-
//# sourceMappingURL=document-drive-
|
|
8337
|
+
//# sourceMappingURL=document-drive-BgHPyTwW.mjs.map
|