@crombolo/content 0.67.0 → 0.69.0
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/package.json +3 -3
- package/src/actor.ts +2 -0
- package/src/operations.ts +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crombolo/content",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.69.0",
|
|
4
4
|
"description": "Internal to crombolo, with no compatibility promise: use @crombolo/crombolo. The rules every page, media and Library write follows, whoever starts it: who may, where it may go, approvals, and what it announces. No transport.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Crombolo",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@crombolo/core": "0.
|
|
33
|
-
"@crombolo/data": "0.
|
|
32
|
+
"@crombolo/core": "0.69.0",
|
|
33
|
+
"@crombolo/data": "0.69.0"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/actor.ts
CHANGED
|
@@ -17,6 +17,8 @@ export interface ContentPrincipal {
|
|
|
17
17
|
languages: readonly string[]
|
|
18
18
|
startNodes: { document: StartNodes; media: StartNodes }
|
|
19
19
|
groups: readonly GroupGrant[]
|
|
20
|
+
/** Signed in by a token exchanged through a provider (story 364): never skips a workflow (367). */
|
|
21
|
+
viaExchange?: { provider: string }
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
/** Where a write came from, for the audit log. */
|
package/src/operations.ts
CHANGED
|
@@ -301,7 +301,13 @@ export function createDocumentOperations(options: DocumentOperationsOptions) {
|
|
|
301
301
|
/** The approval gate, as the actor meets it; `skip` for the system and an operator who chose to. */
|
|
302
302
|
const gateFor = (actor: Actor): { skip: boolean; who: ContentPrincipal | undefined } => {
|
|
303
303
|
if (actor.kind === 'user')
|
|
304
|
-
return {
|
|
304
|
+
return {
|
|
305
|
+
skip:
|
|
306
|
+
actor.skipApproval === true &&
|
|
307
|
+
actor.principal.isAdmin &&
|
|
308
|
+
actor.principal.viaExchange === undefined,
|
|
309
|
+
who: actor.principal,
|
|
310
|
+
}
|
|
305
311
|
if (actor.kind === 'operator') return { skip: actor.skipApproval === true, who: undefined }
|
|
306
312
|
return { skip: true, who: undefined }
|
|
307
313
|
}
|