@htilabs/platform-common-models 0.23.0 → 0.25.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/README.md +104 -0
- package/dist/authz/index.cjs +143 -12
- package/dist/authz/index.cjs.map +1 -1
- package/dist/authz/index.d.cts +121 -12
- package/dist/authz/index.d.ts +121 -12
- package/dist/authz/index.js +136 -12
- package/dist/authz/index.js.map +1 -1
- package/dist/constants/index.cjs +30 -0
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +26 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/{cvcEntry-0BIB9sen.d.cts → cvcEntry-Asg7mxjB.d.cts} +12 -9
- package/dist/{cvcEntry-0BIB9sen.d.ts → cvcEntry-Asg7mxjB.d.ts} +12 -9
- package/dist/{index-CDoqrfc1.d.ts → index-ClTjjJ_S.d.ts} +1 -1
- package/dist/{index-Zu_mOJRn.d.cts → index-Pt82NxQg.d.cts} +1 -1
- package/dist/index.cjs +604 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +577 -15
- package/dist/index.js.map +1 -1
- package/dist/information-scope/index.d.cts +3 -350
- package/dist/information-scope/index.d.ts +3 -350
- package/dist/informationScopeResolver-BzYu97DE.d.cts +351 -0
- package/dist/informationScopeResolver-BzYu97DE.d.ts +351 -0
- package/dist/models/index.cjs +26 -1
- package/dist/models/index.cjs.map +1 -1
- package/dist/models/index.d.cts +2 -2
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +26 -1
- package/dist/models/index.js.map +1 -1
- package/dist/{platform-auth-B49Ly57B.d.cts → platform-auth-DJO-r9Pf.d.cts} +48 -1
- package/dist/{platform-auth-B49Ly57B.d.ts → platform-auth-DJO-r9Pf.d.ts} +48 -1
- package/dist/schemas/index.cjs +26 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +25 -25
- package/dist/schemas/index.d.ts +25 -25
- package/dist/schemas/index.js +26 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/services/index.cjs +26 -1
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +2 -1
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.js +26 -1
- package/dist/services/index.js.map +1 -1
- package/dist/sharing-ceiling/index.cjs +497 -0
- package/dist/sharing-ceiling/index.cjs.map +1 -0
- package/dist/sharing-ceiling/index.d.cts +318 -0
- package/dist/sharing-ceiling/index.d.ts +318 -0
- package/dist/sharing-ceiling/index.js +451 -0
- package/dist/sharing-ceiling/index.js.map +1 -0
- package/dist/types/index.d.cts +11 -3
- package/dist/types/index.d.ts +11 -3
- package/dist/validation/index.cjs +22 -0
- package/dist/validation/index.cjs.map +1 -1
- package/dist/validation/index.js +22 -0
- package/dist/validation/index.js.map +1 -1
- package/package.json +7 -1
- package/src/__sot__/README.md +2 -1
- package/src/__sot__/coreFunctionFields.ts +88 -4
- package/src/__sot__/coreFunctions.pin.json +1040 -113
- package/src/__sot__/sharingStarter.pin.json +229 -0
- package/src/__tests__/authz-resolve.test.ts +115 -31
- package/src/__tests__/core-function-default-bounds.test.ts +374 -0
- package/src/__tests__/core-functions-case-close.test.ts +82 -0
- package/src/__tests__/sharing-starter-canon.test.ts +178 -0
- package/src/authz/defaultBounds.ts +69 -0
- package/src/authz/index.ts +12 -3
- package/src/authz/resolveEffectiveFunctions.ts +69 -29
- package/src/constants/platform-auth.ts +60 -0
- package/src/generated/coreFunctionDefaultBounds.ts +109 -0
- package/src/generated/sharingPlatformStarter.ts +165 -0
- package/src/index.ts +5 -0
- package/src/schemas/platform-role.ts +4 -1
- package/src/sharingCeiling/__tests__/sharingCeiling.test.ts +678 -0
- package/src/sharingCeiling/chain.ts +269 -0
- package/src/sharingCeiling/coverage.ts +346 -0
- package/src/sharingCeiling/index.ts +14 -0
- package/src/sharingCeiling/starter.ts +89 -0
- package/src/types/platform-auth.ts +9 -2
package/dist/authz/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as PermissionStateValue, d as DefaultBoundStateValue } from '../platform-auth-DJO-r9Pf.cjs';
|
|
2
|
+
export { D as DEFAULT_BOUND_STATE, a as DEFAULT_BOUND_STATE_DISPLAY, b as DEFAULT_BOUND_STATE_LABELS, c as DEFAULT_BOUND_STATE_VALUES } from '../platform-auth-DJO-r9Pf.cjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @htilabs/platform-common-models — the shared CVC-133 authorization resolver
|
|
@@ -34,6 +35,17 @@ import { j as PermissionStateValue } from '../platform-auth-B49Ly57B.cjs';
|
|
|
34
35
|
* cascade ends at NEVER / Default-Off simply contributes nothing — it never
|
|
35
36
|
* vetoes another role's grant (`:566-589`, Crysta 2026-08-09 "grants are
|
|
36
37
|
* computed first"; restated 2026-10-12 "roles stack").
|
|
38
|
+
* UNBOUND IS INELIGIBLE (co-p1x, aligned to canon): a role whose Tier-1
|
|
39
|
+
* row carries no state for a function is not eligible for it — the
|
|
40
|
+
* prototype returns `role_ineligible` before any agency layer runs
|
|
41
|
+
* (`:578-584`), so neither an agency override nor a team policy can turn
|
|
42
|
+
* an unbound pair on. For that role it is NEVER, and like every NEVER it
|
|
43
|
+
* is local to the role. (The dev resolvers' tool-overlap default — an
|
|
44
|
+
* unlisted function reading PREF_NO when it shares one of the role's
|
|
45
|
+
* tools, `policyResolver.js:33-40` — is not encoded: it let an agency
|
|
46
|
+
* enable a pair the codebook never bound.) A stored `NA` (the codebook's
|
|
47
|
+
* "Not relevant", `DEFAULT_BOUND_STATE.NA`) is read as NEVER at every
|
|
48
|
+
* tier: non-grantable, and locked at Tier 1.
|
|
37
49
|
* 3. Required is immune to the team gate: a state that is ALWAYS after
|
|
38
50
|
* Tier 1 + Tier 2 (platform ALWAYS, or an agency that escalated the role to
|
|
39
51
|
* ALWAYS) is not team-gated (dev model: "locked" states skip Tier 3,
|
|
@@ -78,9 +90,10 @@ import { j as PermissionStateValue } from '../platform-auth-B49Ly57B.cjs';
|
|
|
78
90
|
* - an `input` that is not an object, or a `roles` / `functions` /
|
|
79
91
|
* `assignedRoleCodes` that is not an array (null, a number, a string —
|
|
80
92
|
* never split into characters), resolves to `[]`;
|
|
81
|
-
* - a present state that is not one of the four PERMISSION_STATE values
|
|
82
|
-
* NEVER at Tier 1, NEVER at Tier 2 (for that
|
|
83
|
-
* Tier 3; `undefined` and `null` mean "not
|
|
93
|
+
* - a present state that is not one of the four PERMISSION_STATE values (or
|
|
94
|
+
* `NA`, read as NEVER) is NEVER at Tier 1, NEVER at Tier 2 (for that
|
|
95
|
+
* role), and a restriction at Tier 3; `undefined` and `null` mean "not
|
|
96
|
+
* set" — which at Tier 1 is unbound, i.e. ineligible;
|
|
84
97
|
* - a state CONTAINER that is present but not a plain object (an array, a
|
|
85
98
|
* string, a Map, …) fails closed for everything it could govern: a role's
|
|
86
99
|
* `functions` → the role grants nothing; the agency's map, or one role's
|
|
@@ -100,22 +113,41 @@ import { j as PermissionStateValue } from '../platform-auth-B49Ly57B.cjs';
|
|
|
100
113
|
|
|
101
114
|
/** True when canon lets the resolver evaluate `code` at all (rule 8). */
|
|
102
115
|
declare function isCanonEvaluableFunction(code: string): boolean;
|
|
103
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* A Tier-2 (agency) or Tier-3 (team) map of function code → state, as the
|
|
118
|
+
* platform stores it. Canon has no NA chip at these tiers, so the type is the
|
|
119
|
+
* four PERMISSION_STATE values; a stored `NA` is still read as NEVER (fail
|
|
120
|
+
* closed), never as a grant.
|
|
121
|
+
*/
|
|
104
122
|
type AuthzStateMap = Readonly<Record<string, PermissionStateValue>>;
|
|
123
|
+
/**
|
|
124
|
+
* A Tier-1 (platform role) map of function code → state: a PERMISSION_STATE
|
|
125
|
+
* value or the codebook's `NA` ("Not relevant", read as NEVER) — what a seed
|
|
126
|
+
* from `CORE_FUNCTION_DEFAULT_BOUNDS` stores. An unlisted function is unbound.
|
|
127
|
+
*/
|
|
128
|
+
type AuthzTier1StateMap = Readonly<Record<string, DefaultBoundStateValue>>;
|
|
105
129
|
/**
|
|
106
130
|
* One `platformRoles` row (Tier 1): the role's platform state per function.
|
|
107
|
-
* A function the role does not list
|
|
108
|
-
*
|
|
109
|
-
*
|
|
131
|
+
* A function the role does not list is UNBOUND for it: the role is ineligible
|
|
132
|
+
* (NEVER for that role, locked — no agency or team layer can enable it), as
|
|
133
|
+
* canon's `authzResolve` rules (`:578-584` `role_ineligible`).
|
|
134
|
+
*
|
|
135
|
+
* `tools` is NOT read by the resolver (since co-p1x, 0.24.0): it used to pick
|
|
136
|
+
* the PREF_NO / NEVER default for an unlisted function. The field stays on the
|
|
137
|
+
* contract because the platform still stores it on `platformRoles`.
|
|
110
138
|
*/
|
|
111
139
|
interface AuthzRoleRow {
|
|
112
140
|
readonly code: string;
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated Ignored by the resolver since 0.24.0 (co-p1x): an unlisted
|
|
143
|
+
* function is unbound, whatever tools the role and function share. Kept on
|
|
144
|
+
* the contract because the platform still stores it.
|
|
145
|
+
*/
|
|
113
146
|
readonly tools?: readonly string[];
|
|
114
|
-
readonly functions?:
|
|
147
|
+
readonly functions?: AuthzTier1StateMap;
|
|
115
148
|
}
|
|
116
149
|
/**
|
|
117
|
-
* One `platformFunctions` row: the deployment's function catalog
|
|
118
|
-
* supplies each function's `tools` (the Tier-1 default above). It can only
|
|
150
|
+
* One `platformFunctions` row: the deployment's function catalog. It can only
|
|
119
151
|
* narrow canon, never widen it:
|
|
120
152
|
* - a code canon does not carry, or carries as not-v1 / retired, is denied
|
|
121
153
|
* even when it is listed here;
|
|
@@ -127,6 +159,10 @@ interface AuthzRoleRow {
|
|
|
127
159
|
*/
|
|
128
160
|
interface AuthzFunctionRow {
|
|
129
161
|
readonly code: string;
|
|
162
|
+
/**
|
|
163
|
+
* @deprecated Ignored by the resolver since 0.24.0 (co-p1x). Kept on the
|
|
164
|
+
* contract because the platform still stores it.
|
|
165
|
+
*/
|
|
130
166
|
readonly tools?: readonly string[];
|
|
131
167
|
readonly retired?: boolean;
|
|
132
168
|
}
|
|
@@ -207,4 +243,77 @@ declare function viewingLevelFromFunctions(effectiveFunctions: Iterable<string>,
|
|
|
207
243
|
*/
|
|
208
244
|
declare function resolveEffectiveViewingLevel(input: ResolveEffectiveFunctionsInput, teamViewingLevel?: ViewingLevel | null): ViewingLevel;
|
|
209
245
|
|
|
210
|
-
|
|
246
|
+
/**
|
|
247
|
+
* @htilabs/platform-common-models — CVC-133 codebook default bounds
|
|
248
|
+
*
|
|
249
|
+
* AUTO-GENERATED FILE — DO NOT EDIT BY HAND.
|
|
250
|
+
* Regenerate with: `python3 scripts/gen-core-functions.py <prototype root>`.
|
|
251
|
+
*
|
|
252
|
+
* For each evaluable function of coreFunctions.v1.3.0.json (canon v1 && !retired,
|
|
253
|
+
* canon @ f4356aa4): role code → the codebook's default bound — canon's
|
|
254
|
+
* always / default_on / default_off / never / not_applicable_roles read
|
|
255
|
+
* ALWAYS / PREF_YES / PREF_NO / NEVER / NA. Role codes are CVC-134 / CVC-135
|
|
256
|
+
* `canonicalCode`s (adminRoles.v2.0.0.json · userRoles.v2.0.0.json); a role not listed is UNBOUND.
|
|
257
|
+
* CODEBOOK DEFAULTS, not live policy: what platform seeds on insert and what
|
|
258
|
+
* "clear" reverts to. GATE L asserts this equals the pinned canon.
|
|
259
|
+
*/
|
|
260
|
+
|
|
261
|
+
declare const CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION = "1.3.0";
|
|
262
|
+
declare const CORE_FUNCTION_DEFAULT_BOUNDS: Readonly<Record<string, Readonly<Record<string, DefaultBoundStateValue>>>>;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @htilabs/platform-common-models — CVC-133 codebook default bounds (co-p1x)
|
|
266
|
+
*
|
|
267
|
+
* The codebook's default bound for every (evaluable function, role) pair:
|
|
268
|
+
* canon's `bounds:` block (records repo `data/cvcs/core_functions.yaml`),
|
|
269
|
+
* generated into `CORE_FUNCTION_DEFAULT_BOUNDS` by
|
|
270
|
+
* `scripts/gen-core-functions.py` and held equal to the pinned canon by GATE L.
|
|
271
|
+
*
|
|
272
|
+
* WHAT THESE ARE — and are not. The kickoff
|
|
273
|
+
* (`KICKOFF_SHARED_AUTHZ_RESOLVER_2026-10-12.md` § 3 rule 7) rules that the
|
|
274
|
+
* live role × function bounds are platform POLICY STATE, edited only by
|
|
275
|
+
* PLT-ADM on Platform Configuration. This module does not change that: it is
|
|
276
|
+
* the CODEBOOK DEFAULT under the policy — what platform seeds into
|
|
277
|
+
* `platformRoles.functions` when a role row is inserted, and what the bounds
|
|
278
|
+
* editor's "clear" reverts to (platform-prototype @ a6f1f3a
|
|
279
|
+
* `PLATFORM_BOUNDS.pristineStateFor`, `src/agencyhub.jsx:2024-2039`; the
|
|
280
|
+
* five chip states always / default_on / default_off / never / na,
|
|
281
|
+
* `src/screens.jsx:19151-19152`). The resolver never reads it: it reads the
|
|
282
|
+
* stored policy rows it is handed (`resolveEffectiveFunctions`).
|
|
283
|
+
*
|
|
284
|
+
* UNBOUND IS INELIGIBLE — aligned to canon (co-p1x, 0.24.0). A role the
|
|
285
|
+
* codebook does not name for a function has no default bound
|
|
286
|
+
* (`codebookDefaultBound` → `null`), and a seeder writes nothing for it.
|
|
287
|
+
* Canon's `authzResolve` returns `role_ineligible` for such a role before any
|
|
288
|
+
* agency layer runs (`src/agencyhub.jsx:578-584`), and
|
|
289
|
+
* `resolveEffectiveFunctions` now does the same: a role row with no stored
|
|
290
|
+
* state for a function is NEVER for that role — no agency override and no
|
|
291
|
+
* team policy can enable the pair — and, like every NEVER, it is local to its
|
|
292
|
+
* role (another held role's grant stands). The dev resolvers' tool-overlap
|
|
293
|
+
* default (unlisted → PREF_NO on a shared tool) is gone; the role and
|
|
294
|
+
* function rows' `tools` are no longer read by the resolver.
|
|
295
|
+
*
|
|
296
|
+
* NA. A platform that seeds Tier 1 verbatim from this map stores `"NA"` for
|
|
297
|
+
* the codebook's "Not relevant" pairs. The resolver reads a stored `NA` as
|
|
298
|
+
* NEVER at every tier (a recognised codebook value, not malformed data): at
|
|
299
|
+
* Tier 1 it is locked, at Tier 2 it denies that role, at Tier 3 it restricts
|
|
300
|
+
* (Required stays immune). Malformed data would deny identically; reading it
|
|
301
|
+
* as NEVER just keeps a legitimate seed out of the malformed class. Only the
|
|
302
|
+
* Tier-1 type admits it (`AuthzTier1StateMap`, `PlatformRoleDef.functions`);
|
|
303
|
+
* agency / team maps stay PermissionStateValue (canon has no NA chip there),
|
|
304
|
+
* and a stored NA there still denies. GATE L's property tests check the
|
|
305
|
+
* resolver, seeded from this map, against an oracle taken from canon
|
|
306
|
+
* `authzResolve` (`:551-628`, with the Required-immunity ruling): every
|
|
307
|
+
* function × role × agency × team value, and every role pair's union.
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* The codebook default bound of `roleCode` (a CVC-134 / CVC-135
|
|
312
|
+
* `canonicalCode`, e.g. `MEM-ADM`, `case_nav`) for `functionCode`, or `null`
|
|
313
|
+
* when the role is unbound for it — including when the function is not
|
|
314
|
+
* evaluable (unknown, retired or not-v1). Own keys only, so an inherited name
|
|
315
|
+
* such as `constructor` is never a function or a role.
|
|
316
|
+
*/
|
|
317
|
+
declare function codebookDefaultBound(functionCode: string, roleCode: string): DefaultBoundStateValue | null;
|
|
318
|
+
|
|
319
|
+
export { type AuthzFunctionRow, type AuthzRoleOverrides, type AuthzRoleRow, type AuthzStateMap, type AuthzTeamPolicy, type AuthzTier1StateMap, CORE_FUNCTION_DEFAULT_BOUNDS, CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION, DefaultBoundStateValue, type ResolveEffectiveFunctionsInput, VIEWING_LEVEL_FUNCTIONS, type ViewingLevel, codebookDefaultBound, isCanonEvaluableFunction, resolveEffectiveFunctions, resolveEffectiveViewingLevel, selectActingTeamId, viewingLevelFromFunctions };
|
package/dist/authz/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as PermissionStateValue, d as DefaultBoundStateValue } from '../platform-auth-DJO-r9Pf.js';
|
|
2
|
+
export { D as DEFAULT_BOUND_STATE, a as DEFAULT_BOUND_STATE_DISPLAY, b as DEFAULT_BOUND_STATE_LABELS, c as DEFAULT_BOUND_STATE_VALUES } from '../platform-auth-DJO-r9Pf.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @htilabs/platform-common-models — the shared CVC-133 authorization resolver
|
|
@@ -34,6 +35,17 @@ import { j as PermissionStateValue } from '../platform-auth-B49Ly57B.js';
|
|
|
34
35
|
* cascade ends at NEVER / Default-Off simply contributes nothing — it never
|
|
35
36
|
* vetoes another role's grant (`:566-589`, Crysta 2026-08-09 "grants are
|
|
36
37
|
* computed first"; restated 2026-10-12 "roles stack").
|
|
38
|
+
* UNBOUND IS INELIGIBLE (co-p1x, aligned to canon): a role whose Tier-1
|
|
39
|
+
* row carries no state for a function is not eligible for it — the
|
|
40
|
+
* prototype returns `role_ineligible` before any agency layer runs
|
|
41
|
+
* (`:578-584`), so neither an agency override nor a team policy can turn
|
|
42
|
+
* an unbound pair on. For that role it is NEVER, and like every NEVER it
|
|
43
|
+
* is local to the role. (The dev resolvers' tool-overlap default — an
|
|
44
|
+
* unlisted function reading PREF_NO when it shares one of the role's
|
|
45
|
+
* tools, `policyResolver.js:33-40` — is not encoded: it let an agency
|
|
46
|
+
* enable a pair the codebook never bound.) A stored `NA` (the codebook's
|
|
47
|
+
* "Not relevant", `DEFAULT_BOUND_STATE.NA`) is read as NEVER at every
|
|
48
|
+
* tier: non-grantable, and locked at Tier 1.
|
|
37
49
|
* 3. Required is immune to the team gate: a state that is ALWAYS after
|
|
38
50
|
* Tier 1 + Tier 2 (platform ALWAYS, or an agency that escalated the role to
|
|
39
51
|
* ALWAYS) is not team-gated (dev model: "locked" states skip Tier 3,
|
|
@@ -78,9 +90,10 @@ import { j as PermissionStateValue } from '../platform-auth-B49Ly57B.js';
|
|
|
78
90
|
* - an `input` that is not an object, or a `roles` / `functions` /
|
|
79
91
|
* `assignedRoleCodes` that is not an array (null, a number, a string —
|
|
80
92
|
* never split into characters), resolves to `[]`;
|
|
81
|
-
* - a present state that is not one of the four PERMISSION_STATE values
|
|
82
|
-
* NEVER at Tier 1, NEVER at Tier 2 (for that
|
|
83
|
-
* Tier 3; `undefined` and `null` mean "not
|
|
93
|
+
* - a present state that is not one of the four PERMISSION_STATE values (or
|
|
94
|
+
* `NA`, read as NEVER) is NEVER at Tier 1, NEVER at Tier 2 (for that
|
|
95
|
+
* role), and a restriction at Tier 3; `undefined` and `null` mean "not
|
|
96
|
+
* set" — which at Tier 1 is unbound, i.e. ineligible;
|
|
84
97
|
* - a state CONTAINER that is present but not a plain object (an array, a
|
|
85
98
|
* string, a Map, …) fails closed for everything it could govern: a role's
|
|
86
99
|
* `functions` → the role grants nothing; the agency's map, or one role's
|
|
@@ -100,22 +113,41 @@ import { j as PermissionStateValue } from '../platform-auth-B49Ly57B.js';
|
|
|
100
113
|
|
|
101
114
|
/** True when canon lets the resolver evaluate `code` at all (rule 8). */
|
|
102
115
|
declare function isCanonEvaluableFunction(code: string): boolean;
|
|
103
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* A Tier-2 (agency) or Tier-3 (team) map of function code → state, as the
|
|
118
|
+
* platform stores it. Canon has no NA chip at these tiers, so the type is the
|
|
119
|
+
* four PERMISSION_STATE values; a stored `NA` is still read as NEVER (fail
|
|
120
|
+
* closed), never as a grant.
|
|
121
|
+
*/
|
|
104
122
|
type AuthzStateMap = Readonly<Record<string, PermissionStateValue>>;
|
|
123
|
+
/**
|
|
124
|
+
* A Tier-1 (platform role) map of function code → state: a PERMISSION_STATE
|
|
125
|
+
* value or the codebook's `NA` ("Not relevant", read as NEVER) — what a seed
|
|
126
|
+
* from `CORE_FUNCTION_DEFAULT_BOUNDS` stores. An unlisted function is unbound.
|
|
127
|
+
*/
|
|
128
|
+
type AuthzTier1StateMap = Readonly<Record<string, DefaultBoundStateValue>>;
|
|
105
129
|
/**
|
|
106
130
|
* One `platformRoles` row (Tier 1): the role's platform state per function.
|
|
107
|
-
* A function the role does not list
|
|
108
|
-
*
|
|
109
|
-
*
|
|
131
|
+
* A function the role does not list is UNBOUND for it: the role is ineligible
|
|
132
|
+
* (NEVER for that role, locked — no agency or team layer can enable it), as
|
|
133
|
+
* canon's `authzResolve` rules (`:578-584` `role_ineligible`).
|
|
134
|
+
*
|
|
135
|
+
* `tools` is NOT read by the resolver (since co-p1x, 0.24.0): it used to pick
|
|
136
|
+
* the PREF_NO / NEVER default for an unlisted function. The field stays on the
|
|
137
|
+
* contract because the platform still stores it on `platformRoles`.
|
|
110
138
|
*/
|
|
111
139
|
interface AuthzRoleRow {
|
|
112
140
|
readonly code: string;
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated Ignored by the resolver since 0.24.0 (co-p1x): an unlisted
|
|
143
|
+
* function is unbound, whatever tools the role and function share. Kept on
|
|
144
|
+
* the contract because the platform still stores it.
|
|
145
|
+
*/
|
|
113
146
|
readonly tools?: readonly string[];
|
|
114
|
-
readonly functions?:
|
|
147
|
+
readonly functions?: AuthzTier1StateMap;
|
|
115
148
|
}
|
|
116
149
|
/**
|
|
117
|
-
* One `platformFunctions` row: the deployment's function catalog
|
|
118
|
-
* supplies each function's `tools` (the Tier-1 default above). It can only
|
|
150
|
+
* One `platformFunctions` row: the deployment's function catalog. It can only
|
|
119
151
|
* narrow canon, never widen it:
|
|
120
152
|
* - a code canon does not carry, or carries as not-v1 / retired, is denied
|
|
121
153
|
* even when it is listed here;
|
|
@@ -127,6 +159,10 @@ interface AuthzRoleRow {
|
|
|
127
159
|
*/
|
|
128
160
|
interface AuthzFunctionRow {
|
|
129
161
|
readonly code: string;
|
|
162
|
+
/**
|
|
163
|
+
* @deprecated Ignored by the resolver since 0.24.0 (co-p1x). Kept on the
|
|
164
|
+
* contract because the platform still stores it.
|
|
165
|
+
*/
|
|
130
166
|
readonly tools?: readonly string[];
|
|
131
167
|
readonly retired?: boolean;
|
|
132
168
|
}
|
|
@@ -207,4 +243,77 @@ declare function viewingLevelFromFunctions(effectiveFunctions: Iterable<string>,
|
|
|
207
243
|
*/
|
|
208
244
|
declare function resolveEffectiveViewingLevel(input: ResolveEffectiveFunctionsInput, teamViewingLevel?: ViewingLevel | null): ViewingLevel;
|
|
209
245
|
|
|
210
|
-
|
|
246
|
+
/**
|
|
247
|
+
* @htilabs/platform-common-models — CVC-133 codebook default bounds
|
|
248
|
+
*
|
|
249
|
+
* AUTO-GENERATED FILE — DO NOT EDIT BY HAND.
|
|
250
|
+
* Regenerate with: `python3 scripts/gen-core-functions.py <prototype root>`.
|
|
251
|
+
*
|
|
252
|
+
* For each evaluable function of coreFunctions.v1.3.0.json (canon v1 && !retired,
|
|
253
|
+
* canon @ f4356aa4): role code → the codebook's default bound — canon's
|
|
254
|
+
* always / default_on / default_off / never / not_applicable_roles read
|
|
255
|
+
* ALWAYS / PREF_YES / PREF_NO / NEVER / NA. Role codes are CVC-134 / CVC-135
|
|
256
|
+
* `canonicalCode`s (adminRoles.v2.0.0.json · userRoles.v2.0.0.json); a role not listed is UNBOUND.
|
|
257
|
+
* CODEBOOK DEFAULTS, not live policy: what platform seeds on insert and what
|
|
258
|
+
* "clear" reverts to. GATE L asserts this equals the pinned canon.
|
|
259
|
+
*/
|
|
260
|
+
|
|
261
|
+
declare const CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION = "1.3.0";
|
|
262
|
+
declare const CORE_FUNCTION_DEFAULT_BOUNDS: Readonly<Record<string, Readonly<Record<string, DefaultBoundStateValue>>>>;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @htilabs/platform-common-models — CVC-133 codebook default bounds (co-p1x)
|
|
266
|
+
*
|
|
267
|
+
* The codebook's default bound for every (evaluable function, role) pair:
|
|
268
|
+
* canon's `bounds:` block (records repo `data/cvcs/core_functions.yaml`),
|
|
269
|
+
* generated into `CORE_FUNCTION_DEFAULT_BOUNDS` by
|
|
270
|
+
* `scripts/gen-core-functions.py` and held equal to the pinned canon by GATE L.
|
|
271
|
+
*
|
|
272
|
+
* WHAT THESE ARE — and are not. The kickoff
|
|
273
|
+
* (`KICKOFF_SHARED_AUTHZ_RESOLVER_2026-10-12.md` § 3 rule 7) rules that the
|
|
274
|
+
* live role × function bounds are platform POLICY STATE, edited only by
|
|
275
|
+
* PLT-ADM on Platform Configuration. This module does not change that: it is
|
|
276
|
+
* the CODEBOOK DEFAULT under the policy — what platform seeds into
|
|
277
|
+
* `platformRoles.functions` when a role row is inserted, and what the bounds
|
|
278
|
+
* editor's "clear" reverts to (platform-prototype @ a6f1f3a
|
|
279
|
+
* `PLATFORM_BOUNDS.pristineStateFor`, `src/agencyhub.jsx:2024-2039`; the
|
|
280
|
+
* five chip states always / default_on / default_off / never / na,
|
|
281
|
+
* `src/screens.jsx:19151-19152`). The resolver never reads it: it reads the
|
|
282
|
+
* stored policy rows it is handed (`resolveEffectiveFunctions`).
|
|
283
|
+
*
|
|
284
|
+
* UNBOUND IS INELIGIBLE — aligned to canon (co-p1x, 0.24.0). A role the
|
|
285
|
+
* codebook does not name for a function has no default bound
|
|
286
|
+
* (`codebookDefaultBound` → `null`), and a seeder writes nothing for it.
|
|
287
|
+
* Canon's `authzResolve` returns `role_ineligible` for such a role before any
|
|
288
|
+
* agency layer runs (`src/agencyhub.jsx:578-584`), and
|
|
289
|
+
* `resolveEffectiveFunctions` now does the same: a role row with no stored
|
|
290
|
+
* state for a function is NEVER for that role — no agency override and no
|
|
291
|
+
* team policy can enable the pair — and, like every NEVER, it is local to its
|
|
292
|
+
* role (another held role's grant stands). The dev resolvers' tool-overlap
|
|
293
|
+
* default (unlisted → PREF_NO on a shared tool) is gone; the role and
|
|
294
|
+
* function rows' `tools` are no longer read by the resolver.
|
|
295
|
+
*
|
|
296
|
+
* NA. A platform that seeds Tier 1 verbatim from this map stores `"NA"` for
|
|
297
|
+
* the codebook's "Not relevant" pairs. The resolver reads a stored `NA` as
|
|
298
|
+
* NEVER at every tier (a recognised codebook value, not malformed data): at
|
|
299
|
+
* Tier 1 it is locked, at Tier 2 it denies that role, at Tier 3 it restricts
|
|
300
|
+
* (Required stays immune). Malformed data would deny identically; reading it
|
|
301
|
+
* as NEVER just keeps a legitimate seed out of the malformed class. Only the
|
|
302
|
+
* Tier-1 type admits it (`AuthzTier1StateMap`, `PlatformRoleDef.functions`);
|
|
303
|
+
* agency / team maps stay PermissionStateValue (canon has no NA chip there),
|
|
304
|
+
* and a stored NA there still denies. GATE L's property tests check the
|
|
305
|
+
* resolver, seeded from this map, against an oracle taken from canon
|
|
306
|
+
* `authzResolve` (`:551-628`, with the Required-immunity ruling): every
|
|
307
|
+
* function × role × agency × team value, and every role pair's union.
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* The codebook default bound of `roleCode` (a CVC-134 / CVC-135
|
|
312
|
+
* `canonicalCode`, e.g. `MEM-ADM`, `case_nav`) for `functionCode`, or `null`
|
|
313
|
+
* when the role is unbound for it — including when the function is not
|
|
314
|
+
* evaluable (unknown, retired or not-v1). Own keys only, so an inherited name
|
|
315
|
+
* such as `constructor` is never a function or a role.
|
|
316
|
+
*/
|
|
317
|
+
declare function codebookDefaultBound(functionCode: string, roleCode: string): DefaultBoundStateValue | null;
|
|
318
|
+
|
|
319
|
+
export { type AuthzFunctionRow, type AuthzRoleOverrides, type AuthzRoleRow, type AuthzStateMap, type AuthzTeamPolicy, type AuthzTier1StateMap, CORE_FUNCTION_DEFAULT_BOUNDS, CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION, DefaultBoundStateValue, type ResolveEffectiveFunctionsInput, VIEWING_LEVEL_FUNCTIONS, type ViewingLevel, codebookDefaultBound, isCanonEvaluableFunction, resolveEffectiveFunctions, resolveEffectiveViewingLevel, selectActingTeamId, viewingLevelFromFunctions };
|
package/dist/authz/index.js
CHANGED
|
@@ -47,6 +47,28 @@ var PERMISSION_STATE_DISPLAY = {
|
|
|
47
47
|
icon: "\u{1F512}"
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
+
var DEFAULT_BOUND_STATE = {
|
|
51
|
+
...PERMISSION_STATE,
|
|
52
|
+
/** Not relevant — canon's `not_applicable_roles` for this function. */
|
|
53
|
+
NA: "NA"
|
|
54
|
+
};
|
|
55
|
+
var DEFAULT_BOUND_STATE_VALUES = [
|
|
56
|
+
...PERMISSION_STATE_VALUES,
|
|
57
|
+
DEFAULT_BOUND_STATE.NA
|
|
58
|
+
];
|
|
59
|
+
var DEFAULT_BOUND_STATE_LABELS = {
|
|
60
|
+
...PERMISSION_STATE_LABELS,
|
|
61
|
+
[DEFAULT_BOUND_STATE.NA]: "Not relevant"
|
|
62
|
+
};
|
|
63
|
+
var DEFAULT_BOUND_STATE_DISPLAY = {
|
|
64
|
+
...PERMISSION_STATE_DISPLAY,
|
|
65
|
+
[DEFAULT_BOUND_STATE.NA]: {
|
|
66
|
+
label: "Not relevant",
|
|
67
|
+
color: "#616161",
|
|
68
|
+
bgColor: "#f5f5f5",
|
|
69
|
+
icon: "\u25CC"
|
|
70
|
+
}
|
|
71
|
+
};
|
|
50
72
|
var SHARE_VIEW = {
|
|
51
73
|
/** System metadata only (partial access). */
|
|
52
74
|
SYS_INFO: "sys_info",
|
|
@@ -373,11 +395,9 @@ var STATES = new Set(Object.values(PERMISSION_STATE));
|
|
|
373
395
|
function readState(map, code) {
|
|
374
396
|
const v = own(map, code);
|
|
375
397
|
if (v === void 0 || v === null) return void 0;
|
|
398
|
+
if (v === DEFAULT_BOUND_STATE.NA) return PERMISSION_STATE.NEVER;
|
|
376
399
|
return typeof v === "string" && STATES.has(v) ? v : "malformed";
|
|
377
400
|
}
|
|
378
|
-
function stringList(v) {
|
|
379
|
-
return Array.isArray(v) ? v.filter((x) => typeof x === "string") : [];
|
|
380
|
-
}
|
|
381
401
|
function teamValueRestricts(map, code) {
|
|
382
402
|
const gate = readState(map, code);
|
|
383
403
|
return gate !== void 0 && gate !== PERMISSION_STATE.PREF_YES && gate !== PERMISSION_STATE.ALWAYS;
|
|
@@ -450,31 +470,30 @@ function resolveEffectiveFunctions(input) {
|
|
|
450
470
|
const retired = own(fn, "retired");
|
|
451
471
|
if (typeof code !== "string" || !isCanonEvaluableFunction(code)) continue;
|
|
452
472
|
if (retired !== void 0 && retired !== false) continue;
|
|
453
|
-
vocabulary.push(
|
|
473
|
+
vocabulary.push(code);
|
|
454
474
|
}
|
|
455
475
|
const agencyAll = readContainer(input.agencyOverrides);
|
|
456
476
|
const team = compileTeamGate(input.teamPolicy);
|
|
457
477
|
const granted = /* @__PURE__ */ new Set();
|
|
458
478
|
for (const roleCode of heldCodes) {
|
|
459
479
|
const role = rolesByCode.get(roleCode);
|
|
460
|
-
const roleTools = new Set(stringList(own(role, "tools")));
|
|
461
480
|
const roleFunctions = readContainer(own(role, "functions"));
|
|
462
481
|
if (roleFunctions.kind === "malformed") continue;
|
|
463
482
|
const agency = agencyAll.kind === "map" ? readContainer(own(agencyAll.map, roleCode)) : agencyAll;
|
|
464
483
|
for (const fn of vocabulary) {
|
|
465
|
-
if (granted.has(fn
|
|
466
|
-
const listed = roleFunctions.kind === "map" ? readState(roleFunctions.map, fn
|
|
467
|
-
|
|
468
|
-
const tier1 = listed === "malformed" ? PERMISSION_STATE.NEVER : listed
|
|
484
|
+
if (granted.has(fn)) continue;
|
|
485
|
+
const listed = roleFunctions.kind === "map" ? readState(roleFunctions.map, fn) : void 0;
|
|
486
|
+
if (listed === void 0) continue;
|
|
487
|
+
const tier1 = listed === "malformed" ? PERMISSION_STATE.NEVER : listed;
|
|
469
488
|
let state = tier1;
|
|
470
489
|
if (tier1 !== PERMISSION_STATE.ALWAYS && tier1 !== PERMISSION_STATE.NEVER) {
|
|
471
|
-
const override = agency.kind === "malformed" ? "malformed" : agency.kind === "map" ? readState(agency.map, fn
|
|
490
|
+
const override = agency.kind === "malformed" ? "malformed" : agency.kind === "map" ? readState(agency.map, fn) : void 0;
|
|
472
491
|
if (override === "malformed") state = PERMISSION_STATE.NEVER;
|
|
473
492
|
else if (override !== void 0) state = override;
|
|
474
493
|
}
|
|
475
494
|
if (state !== PERMISSION_STATE.ALWAYS && state !== PERMISSION_STATE.PREF_YES) continue;
|
|
476
|
-
if (state !== PERMISSION_STATE.ALWAYS && teamRestricts(team, roleCode, fn
|
|
477
|
-
granted.add(fn
|
|
495
|
+
if (state !== PERMISSION_STATE.ALWAYS && teamRestricts(team, roleCode, fn)) continue;
|
|
496
|
+
granted.add(fn);
|
|
478
497
|
}
|
|
479
498
|
}
|
|
480
499
|
return [...granted].sort();
|
|
@@ -496,8 +515,113 @@ function viewingLevelFromFunctions(effectiveFunctions, teamViewingLevel) {
|
|
|
496
515
|
function resolveEffectiveViewingLevel(input, teamViewingLevel) {
|
|
497
516
|
return viewingLevelFromFunctions(resolveEffectiveFunctions(input), teamViewingLevel);
|
|
498
517
|
}
|
|
518
|
+
|
|
519
|
+
// src/generated/coreFunctionDefaultBounds.ts
|
|
520
|
+
var CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION = "1.3.0";
|
|
521
|
+
var CORE_FUNCTION_DEFAULT_BOUNDS = {
|
|
522
|
+
"agency_info_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "TEAM-ADM": "PREF_YES" },
|
|
523
|
+
"announcement_publish": { "MEM-ADM": "PREF_NO", "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
524
|
+
"api_key_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "NEVER", "case_nav": "NA", "research_analytics": "NA" },
|
|
525
|
+
"assessments_conduct": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "PREF_YES", "crisis_response": "NEVER", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "NEVER", "research_analytics": "NA", "screener": "NEVER", "volunteer": "NEVER" },
|
|
526
|
+
"auth_model_manage_platform": { "AUD": "NEVER", "CIRO": "NEVER", "DATA-ADM": "NEVER", "GOV-AUD": "NEVER", "MEM-ADM": "NEVER", "PLT-ADM": "ALWAYS", "PLT-SUP": "NEVER", "SUP": "NEVER", "TEAM-ADM": "NEVER", "research_analytics": "NA" },
|
|
527
|
+
"case_assign_reassign": { "AUD": "NA", "CIRO": "NA", "DATA-ADM": "NA", "GOV-AUD": "NA", "MEM-ADM": "ALWAYS", "PLT-ADM": "NA", "SUP": "ALWAYS", "TEAM-ADM": "PREF_YES", "behavioral_health_provider": "NA", "case_nav": "ALWAYS", "crisis_response": "NA", "healthcare_provider_medical": "NA", "intel_analyst": "NA", "investigator": "NA", "le_liaison_vsp": "NA", "legal_advocate": "NA", "mandatory_reporter": "NA", "mdt_participant": "NA", "prosecutor_review": "NA", "public_reporter": "NA", "research_analytics": "NA", "screener": "NA", "volunteer": "NA" },
|
|
528
|
+
"case_claim": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_YES", "intel_analyst": "PREF_YES", "investigator": "PREF_YES", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_YES", "mandatory_reporter": "PREF_YES", "mdt_participant": "PREF_YES", "prosecutor_review": "PREF_YES", "public_reporter": "PREF_YES", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_YES" },
|
|
529
|
+
"case_close": { "AUD": "NA", "CIRO": "NA", "DATA-ADM": "NA", "GOV-AUD": "NA", "MEM-ADM": "ALWAYS", "PLT-ADM": "NA", "SUP": "ALWAYS", "TEAM-ADM": "PREF_YES", "behavioral_health_provider": "NA", "case_nav": "ALWAYS", "crisis_response": "NA", "healthcare_provider_medical": "NA", "intel_analyst": "NA", "investigator": "NA", "le_liaison_vsp": "NA", "legal_advocate": "NA", "mandatory_reporter": "NA", "mdt_participant": "NA", "prosecutor_review": "NA", "public_reporter": "NA", "research_analytics": "NA", "screener": "NA", "volunteer": "NA" },
|
|
530
|
+
"case_collaborator_add": { "case_nav": "NA", "investigator": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA" },
|
|
531
|
+
"case_edit": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "PREF_YES", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_NO" },
|
|
532
|
+
"case_reopen": { "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "investigator": "ALWAYS", "le_liaison_vsp": "NEVER", "research_analytics": "NA", "screener": "NEVER", "volunteer": "PREF_NO" },
|
|
533
|
+
"case_side_panel_use": { "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_YES", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_YES", "mdt_participant": "PREF_YES", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_NO" },
|
|
534
|
+
"case_status_manage": { "SUP": "PREF_YES", "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
535
|
+
"case_transfer_bulk": { "MEM-ADM": "PREF_YES", "PLT-ADM": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "PREF_NO", "research_analytics": "NA" },
|
|
536
|
+
"case_view": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "PREF_YES", "mdt_participant": "PREF_YES", "prosecutor_review": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "NEVER" },
|
|
537
|
+
"case_visibility_manage": { "MEM-ADM": "ALWAYS", "SUP": "ALWAYS", "case_nav": "NA", "intel_analyst": "PREF_NO", "investigator": "ALWAYS", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
538
|
+
"ci_periodic_review": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
539
|
+
"ci_record_purge_or_retire": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
540
|
+
"ci_record_validate": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
541
|
+
"ci_to_evidence_export_authorize": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
542
|
+
"deconfliction_alert_acknowledge": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
543
|
+
"deconfliction_unmask": { "case_nav": "NA", "intel_analyst": "PREF_YES", "investigator": "ALWAYS", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
544
|
+
"determination_perform": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "PREF_YES", "crisis_response": "NEVER", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "NEVER", "legal_advocate": "PREF_YES", "research_analytics": "NA", "screener": "NEVER", "volunteer": "NEVER" },
|
|
545
|
+
"disclose_external_request": { "CIRO": "PREF_YES", "PLT-ADM": "ALWAYS", "case_nav": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS" },
|
|
546
|
+
"enrollment_manage": { "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "healthcare_provider_medical": "PREF_YES", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "PREF_NO", "volunteer": "PREF_NO" },
|
|
547
|
+
"exit_discharge_conduct": { "case_nav": "ALWAYS", "crisis_response": "PREF_NO", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "NEVER", "volunteer": "NEVER" },
|
|
548
|
+
"export_deidentified": { "DATA-ADM": "PREF_YES", "PLT-ADM": "ALWAYS", "research_analytics": "PREF_YES" },
|
|
549
|
+
"goals_plan_manage": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_NO", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "volunteer": "PREF_NO" },
|
|
550
|
+
"idb_record_create": { "PLT-ADM": "ALWAYS", "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
551
|
+
"indicator_manual_add": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "PREF_YES", "investigator": "PREF_YES", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_NO" },
|
|
552
|
+
"investigation_create_claim": { "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
553
|
+
"investigation_session_run": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "PREF_YES", "research_analytics": "NA" },
|
|
554
|
+
"investigative_database_search": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
555
|
+
"investigative_request_send": { "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
556
|
+
"lead_create": { "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
557
|
+
"lead_publish": { "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
558
|
+
"lead_route_assign": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
559
|
+
"lead_triage_manage": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
560
|
+
"magic_link_share_send": { "PLT-ADM": "NA", "case_nav": "PREF_YES", "crisis_response": "PREF_YES", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_YES", "mdt_participant": "ALWAYS", "research_analytics": "NA", "screener": "PREF_NO", "volunteer": "PREF_NO" },
|
|
561
|
+
"mandatory_report_send": { "MEM-ADM": "PREF_YES", "PLT-ADM": "NA", "SUP": "PREF_YES", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "healthcare_provider_medical": "PREF_YES", "mandatory_reporter": "ALWAYS", "public_reporter": "PREF_NO", "screener": "PREF_NO", "volunteer": "PREF_NO" },
|
|
562
|
+
"member_account_report_generate": { "DATA-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "research_analytics": "PREF_YES" },
|
|
563
|
+
"member_onboarding_support": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "research_analytics": "NA" },
|
|
564
|
+
"message_moderate": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS" },
|
|
565
|
+
"message_send": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS", "mandatory_reporter": "ALWAYS", "mdt_participant": "ALWAYS", "prosecutor_review": "ALWAYS", "public_reporter": "PREF_NO", "research_analytics": "ALWAYS", "screener": "ALWAYS", "volunteer": "PREF_YES" },
|
|
566
|
+
"milestone_log": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
567
|
+
"needs_priorities_conduct": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "PREF_YES", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_YES" },
|
|
568
|
+
"network_corpus_access": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
569
|
+
"note_open_departed_author": { "MEM-ADM": "PREF_NO" },
|
|
570
|
+
"onboarding_config_sign_off": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS" },
|
|
571
|
+
"open_source_search": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS" },
|
|
572
|
+
"person_association_update": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA", "screener": "PREF_YES" },
|
|
573
|
+
"person_merge_manage": { "PLT-ADM": "ALWAYS", "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "PREF_YES", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
574
|
+
"platform_perm_modify": { "PLT-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
575
|
+
"profile_domain_edit": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_NO" },
|
|
576
|
+
"record_activity_view": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_YES", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "PREF_YES", "legal_advocate": "ALWAYS", "mdt_participant": "PREF_YES", "prosecutor_review": "ALWAYS", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_NO" },
|
|
577
|
+
"record_print": { "CIRO": "PREF_YES", "PLT-ADM": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "investigator": "ALWAYS", "le_liaison_vsp": "NEVER", "legal_advocate": "ALWAYS", "prosecutor_review": "ALWAYS", "research_analytics": "ALWAYS", "screener": "PREF_NO", "volunteer": "NEVER" },
|
|
578
|
+
"referral_receive_external": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_YES", "intel_analyst": "PREF_YES", "investigator": "PREF_YES", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_YES", "mandatory_reporter": "PREF_YES", "mdt_participant": "PREF_YES", "prosecutor_review": "ALWAYS", "public_reporter": "PREF_YES", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_YES" },
|
|
579
|
+
"referral_receive_internal": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "PREF_NO", "healthcare_provider_medical": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_NO" },
|
|
580
|
+
"referral_send_external": { "PLT-ADM": "NA", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "le_liaison_vsp": "ALWAYS", "mandatory_reporter": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_YES" },
|
|
581
|
+
"referral_send_internal": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "le_liaison_vsp": "ALWAYS", "mandatory_reporter": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "ALWAYS" },
|
|
582
|
+
"roi_submit_manage": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "ALWAYS" },
|
|
583
|
+
"role_assign": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NA", "TEAM-ADM": "PREF_NO", "research_analytics": "NA" },
|
|
584
|
+
"roles_accounts_toggle": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS" },
|
|
585
|
+
"sandbox_environment_manage": { "PLT-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
586
|
+
"screening_conduct": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "PREF_YES", "crisis_response": "PREF_YES", "healthcare_provider_medical": "ALWAYS", "legal_advocate": "PREF_YES", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_YES" },
|
|
587
|
+
"screening_view": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "PREF_NO", "healthcare_provider_medical": "ALWAYS", "le_liaison_vsp": "NEVER", "prosecutor_review": "NEVER", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "NEVER" },
|
|
588
|
+
"service_log_manage": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "PREF_YES", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_YES" },
|
|
589
|
+
"session_create": { "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS", "mandatory_reporter": "ALWAYS", "mdt_participant": "ALWAYS", "prosecutor_review": "ALWAYS", "public_reporter": "ALWAYS", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "ALWAYS" },
|
|
590
|
+
"share_config": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "PREF_YES", "SUP": "NEVER", "TEAM-ADM": "NEVER", "research_analytics": "NA" },
|
|
591
|
+
"share_revoke": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_YES", "le_liaison_vsp": "PREF_YES", "legal_advocate": "ALWAYS", "mdt_participant": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "PREF_NO", "volunteer": "PREF_NO" },
|
|
592
|
+
"share_rule_approve_cross_agency": { "GOV-AUD": "PREF_YES", "PLT-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
593
|
+
"share_vsp_to_le": { "PLT-ADM": "ALWAYS", "case_nav": "PREF_YES", "crisis_response": "NA", "le_liaison_vsp": "ALWAYS", "research_analytics": "NA", "screener": "NEVER", "volunteer": "NEVER" },
|
|
594
|
+
"srl_manage": { "DATA-ADM": "PREF_YES", "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "TEAM-ADM": "PREF_YES" },
|
|
595
|
+
"supervisee_thread_view": { "PLT-ADM": "ALWAYS", "SUP": "ALWAYS", "TEAM-ADM": "PREF_YES", "case_nav": "NA" },
|
|
596
|
+
"support_ticket_triage": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
597
|
+
"system_diagnostics_view": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
598
|
+
"team_config_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "NEVER", "research_analytics": "NA" },
|
|
599
|
+
"team_membership_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NA", "TEAM-ADM": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
600
|
+
"team_share_narrowing": { "MEM-ADM": "ALWAYS", "SUP": "PREF_NO", "TEAM-ADM": "PREF_YES", "research_analytics": "NA" },
|
|
601
|
+
"team_workflow_config_manage": { "MEM-ADM": "ALWAYS", "TEAM-ADM": "PREF_YES", "research_analytics": "NA" },
|
|
602
|
+
"training_gate_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "PREF_YES", "SUP": "NA", "TEAM-ADM": "PREF_YES", "TRAIN-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
603
|
+
"usr_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "PREF_NO", "research_analytics": "NA" },
|
|
604
|
+
"viewing_config_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "PREF_YES" },
|
|
605
|
+
"viewing_level_1_search": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "PREF_YES", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_YES", "mandatory_reporter": "PREF_NO", "mdt_participant": "PREF_YES", "prosecutor_review": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_NO" },
|
|
606
|
+
"viewing_level_2_autocomplete": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_NO", "intel_analyst": "PREF_YES", "investigator": "ALWAYS", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_NO", "mandatory_reporter": "NEVER", "mdt_participant": "PREF_NO", "prosecutor_review": "PREF_NO", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "NEVER" },
|
|
607
|
+
"viewing_level_3_components": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_NO", "case_nav": "PREF_YES", "crisis_response": "PREF_NO", "healthcare_provider_medical": "PREF_NO", "intel_analyst": "PREF_NO", "investigator": "PREF_YES", "le_liaison_vsp": "PREF_NO", "legal_advocate": "PREF_NO", "mandatory_reporter": "NEVER", "mdt_participant": "PREF_NO", "prosecutor_review": "PREF_NO", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "NEVER" }
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
// src/authz/defaultBounds.ts
|
|
611
|
+
function codebookDefaultBound(functionCode, roleCode) {
|
|
612
|
+
if (!Object.hasOwn(CORE_FUNCTION_DEFAULT_BOUNDS, functionCode)) return null;
|
|
613
|
+
const roles = CORE_FUNCTION_DEFAULT_BOUNDS[functionCode];
|
|
614
|
+
return Object.hasOwn(roles, roleCode) ? roles[roleCode] : null;
|
|
615
|
+
}
|
|
499
616
|
export {
|
|
617
|
+
CORE_FUNCTION_DEFAULT_BOUNDS,
|
|
618
|
+
CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION,
|
|
619
|
+
DEFAULT_BOUND_STATE,
|
|
620
|
+
DEFAULT_BOUND_STATE_DISPLAY,
|
|
621
|
+
DEFAULT_BOUND_STATE_LABELS,
|
|
622
|
+
DEFAULT_BOUND_STATE_VALUES,
|
|
500
623
|
VIEWING_LEVEL_FUNCTIONS,
|
|
624
|
+
codebookDefaultBound,
|
|
501
625
|
isCanonEvaluableFunction,
|
|
502
626
|
resolveEffectiveFunctions,
|
|
503
627
|
resolveEffectiveViewingLevel,
|