@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
|
@@ -4352,10 +4352,35 @@ function evaluateNode(node, subject, request, conditions) {
|
|
|
4352
4352
|
function evaluateCondition(condition, subject, request, conditions) {
|
|
4353
4353
|
return evaluateNode(condition, subject, request, conditions) === true;
|
|
4354
4354
|
}
|
|
4355
|
+
/** Whether a capability's scope reaches the requested one. */
|
|
4356
|
+
function scopeCovers(scope, requested) {
|
|
4357
|
+
return scope === void 0 || scope === "*" || scope === requested;
|
|
4358
|
+
}
|
|
4359
|
+
/**
|
|
4360
|
+
* Whether one grant answers this request.
|
|
4361
|
+
*
|
|
4362
|
+
* A grant allowing execute on a scope also allows reading it: executing an
|
|
4363
|
+
* operation means reading the state it applies to, so permitting the write while
|
|
4364
|
+
* withholding the read would describe an access nobody could use. The converse
|
|
4365
|
+
* does not hold -- a read grant confers no write.
|
|
4366
|
+
*
|
|
4367
|
+
* Only an allow carries across. A deny on execute withholds the write and says
|
|
4368
|
+
* nothing about the read, so a policy locking writes down does not silently
|
|
4369
|
+
* revoke a read grant sitting before it. The operation list is not consulted
|
|
4370
|
+
* either: it restricts which operations may be executed, not whether the scope
|
|
4371
|
+
* is visible, and a read carries no operation to match against.
|
|
4372
|
+
*
|
|
4373
|
+
* Reads are not consensus -- no replica records a read, and the two read call
|
|
4374
|
+
* sites are both inside the read gate -- so this rule is not part of what makes
|
|
4375
|
+
* an operation valid, and does not need a policy version of its own.
|
|
4376
|
+
*/
|
|
4377
|
+
function grantAnswers(grant, request) {
|
|
4378
|
+
if (capabilityCovers(grant.capability, request)) return true;
|
|
4379
|
+
return request.verb === "read" && grant.effect === "allow" && grant.capability.can === "execute" && scopeCovers(grant.capability.scope, request.scope);
|
|
4380
|
+
}
|
|
4355
4381
|
function capabilityCovers(capability, request) {
|
|
4356
4382
|
if (capability.can !== request.verb) return false;
|
|
4357
|
-
|
|
4358
|
-
if (scope !== void 0 && scope !== "*" && scope !== request.scope) return false;
|
|
4383
|
+
if (!scopeCovers(capability.scope, request.scope)) return false;
|
|
4359
4384
|
if (capability.can === "execute") {
|
|
4360
4385
|
if (capability.operation === void 0) return true;
|
|
4361
4386
|
return request.operation !== void 0 && capability.operation.includes(request.operation);
|
|
@@ -4392,7 +4417,7 @@ function evaluateGrantStack(grants, subject, request, groups, conditions) {
|
|
|
4392
4417
|
if (conditions === void 0) continue;
|
|
4393
4418
|
if (!evaluateCondition(grant.where, subject, request, conditions)) continue;
|
|
4394
4419
|
}
|
|
4395
|
-
if (
|
|
4420
|
+
if (grantAnswers(grant, request) && principalMatches(grant.principal, subject, request, groups, conditions)) applicable = grant;
|
|
4396
4421
|
}
|
|
4397
4422
|
if (applicable === void 0) return {
|
|
4398
4423
|
decision: "deny",
|
|
@@ -5528,7 +5553,7 @@ function replayDocument(initialState, operations, reducer, header, dispatch, ski
|
|
|
5528
5553
|
};
|
|
5529
5554
|
let result = document;
|
|
5530
5555
|
if (operationsToReplay.length) result = operationsToReplay.reduce((document, operation) => {
|
|
5531
|
-
if (isDenied(operation)) return appendWithoutApplying(document, operation);
|
|
5556
|
+
if (isDenied(operation)) return updateHeaderRevision(appendWithoutApplying(document, operation), operation.action.scope, operation.timestampUtcMs);
|
|
5532
5557
|
return reducer(document, operation.action, dispatch, {
|
|
5533
5558
|
ignoreSkipOperations: true,
|
|
5534
5559
|
checkHashes,
|
|
@@ -7020,7 +7045,7 @@ function replayDocumentVersioned(initialState, operations, config, header, dispa
|
|
|
7020
7045
|
const segEnd = k < validatedUpgrades.length ? boundaries[k]?.[s] ?? ops.length : ops.length;
|
|
7021
7046
|
const segOps = ops.slice(segStart, segEnd);
|
|
7022
7047
|
for (const op of segOps) {
|
|
7023
|
-
if (isDenied(op)) document = appendWithoutApplying(document, op, s);
|
|
7048
|
+
if (isDenied(op)) document = updateHeaderRevision(appendWithoutApplying(document, op, s), s, op.timestampUtcMs);
|
|
7024
7049
|
else document = reducer(document, op.action, dispatch, {
|
|
7025
7050
|
ignoreSkipOperations: true,
|
|
7026
7051
|
checkHashes,
|
|
@@ -8292,4 +8317,4 @@ const driveDocumentModelModule = {
|
|
|
8292
8317
|
//#endregion
|
|
8293
8318
|
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 };
|
|
8294
8319
|
|
|
8295
|
-
//# sourceMappingURL=document-drive-
|
|
8320
|
+
//# sourceMappingURL=document-drive-CJz0STcj.js.map
|