@htilabs/platform-common-models 0.23.0 → 0.24.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 +39 -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-BqAGctqK.d.cts} +4 -1
- package/dist/{cvcEntry-0BIB9sen.d.ts → cvcEntry-BqAGctqK.d.ts} +4 -1
- package/dist/{index-Zu_mOJRn.d.cts → index-BTqHP4DM.d.cts} +1 -1
- package/dist/{index-CDoqrfc1.d.ts → index-Dr6GBCoY.d.ts} +1 -1
- package/dist/index.cjs +147 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +140 -13
- package/dist/index.js.map +1 -1
- 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 +1 -1
- package/dist/schemas/index.d.ts +1 -1
- 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.js +26 -1
- package/dist/services/index.js.map +1 -1
- 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 +1 -1
- package/src/__sot__/README.md +1 -1
- package/src/__sot__/coreFunctionFields.ts +88 -4
- package/src/__sot__/coreFunctions.pin.json +1040 -113
- 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/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/schemas/platform-role.ts +4 -1
- package/src/types/platform-auth.ts +9 -2
package/README.md
CHANGED
|
@@ -16,6 +16,45 @@ Package exports are organized into a public root API and a small number of
|
|
|
16
16
|
dedicated subpaths (`/validation`, `/cvcs`) — consult `package.json` for the
|
|
17
17
|
authoritative `exports` map.
|
|
18
18
|
|
|
19
|
+
## authz / 0.24.0 migration
|
|
20
|
+
|
|
21
|
+
0.24.0 (co-p1x) ships the CVC-133 **codebook default bounds** and aligns the
|
|
22
|
+
shared resolver (`@htilabs/platform-common-models/authz`) with canon's
|
|
23
|
+
`authzResolve` (platform-prototype `src/agencyhub.jsx:578-584`).
|
|
24
|
+
|
|
25
|
+
- **New:** `CORE_FUNCTION_DEFAULT_BOUNDS` — for each of the 86 evaluable
|
|
26
|
+
CVC-133 functions, role `canonicalCode` (CVC-134 / CVC-135, e.g. `MEM-ADM`,
|
|
27
|
+
`case_nav`) → `ALWAYS` | `PREF_YES` | `PREF_NO` | `NEVER` | `NA`
|
|
28
|
+
(627 pairs, 154 `NA`), generated from canon and held equal to it by GATE L.
|
|
29
|
+
`codebookDefaultBound(fn, role)` returns the state or `null` (unbound).
|
|
30
|
+
These are codebook DEFAULTS — what platform seeds and what the bounds
|
|
31
|
+
editor's "clear" reverts to. The live role × function bounds stay platform
|
|
32
|
+
policy state.
|
|
33
|
+
- **Unlisted means ineligible.** A `platformRoles` row with no state for a
|
|
34
|
+
function is UNBOUND for it: the role contributes nothing, and no agency
|
|
35
|
+
override or team policy can switch the pair on. It is local to the role, so
|
|
36
|
+
another held role's grant still stands. A stored `NA` reads as `NEVER` at
|
|
37
|
+
every tier.
|
|
38
|
+
- **`tools` is ignored.** `AuthzRoleRow.tools` / `AuthzFunctionRow.tools` are
|
|
39
|
+
`@deprecated`: the old default (an unlisted function reading `PREF_NO` when
|
|
40
|
+
the role and function share a tool) is gone. The fields stay on the
|
|
41
|
+
contract because the platform still stores them.
|
|
42
|
+
- **Types.** A role row's `functions` is `AuthzTier1StateMap` and
|
|
43
|
+
`PlatformRoleDef.functions` is `Record<string, DefaultBoundStateValue>`
|
|
44
|
+
(they accept `NA`). Agency and team maps (`AuthzStateMap`) stay
|
|
45
|
+
`PermissionStateValue`: canon has no NA chip there. To label a Tier-1 value
|
|
46
|
+
use `DEFAULT_BOUND_STATE_LABELS` / `DEFAULT_BOUND_STATE_DISPLAY`;
|
|
47
|
+
`PERMISSION_STATE_LABELS` / `_DISPLAY` keep their four keys and would look
|
|
48
|
+
up `undefined` for `NA`.
|
|
49
|
+
|
|
50
|
+
**Consumers MUST seed every (function, role) pair the codebook binds from
|
|
51
|
+
`CORE_FUNCTION_DEFAULT_BOUNDS` before adopting 0.24.0**, or sparse
|
|
52
|
+
`platformRoles` rows lose grants they used to get through the tool default.
|
|
53
|
+
Example (at review time): the platform's hand seed was missing 141 `ALWAYS`,
|
|
54
|
+
84 `PREF_YES` and 38 `PREF_NO` pairs, and had no `crisis_response` row at all.
|
|
55
|
+
Seeding `NA` is optional (absent and `NA` both deny); seeding `NEVER` for an
|
|
56
|
+
unbound pair is not needed.
|
|
57
|
+
|
|
19
58
|
## Seeding CVCs
|
|
20
59
|
|
|
21
60
|
The CVC Source-of-Truth catalogs under `src/cvcs/` are seeded into MongoDB with:
|
package/dist/authz/index.cjs
CHANGED
|
@@ -20,7 +20,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/authz/index.ts
|
|
21
21
|
var authz_exports = {};
|
|
22
22
|
__export(authz_exports, {
|
|
23
|
+
CORE_FUNCTION_DEFAULT_BOUNDS: () => CORE_FUNCTION_DEFAULT_BOUNDS,
|
|
24
|
+
CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION: () => CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION,
|
|
25
|
+
DEFAULT_BOUND_STATE: () => DEFAULT_BOUND_STATE,
|
|
26
|
+
DEFAULT_BOUND_STATE_DISPLAY: () => DEFAULT_BOUND_STATE_DISPLAY,
|
|
27
|
+
DEFAULT_BOUND_STATE_LABELS: () => DEFAULT_BOUND_STATE_LABELS,
|
|
28
|
+
DEFAULT_BOUND_STATE_VALUES: () => DEFAULT_BOUND_STATE_VALUES,
|
|
23
29
|
VIEWING_LEVEL_FUNCTIONS: () => VIEWING_LEVEL_FUNCTIONS,
|
|
30
|
+
codebookDefaultBound: () => codebookDefaultBound,
|
|
24
31
|
isCanonEvaluableFunction: () => isCanonEvaluableFunction,
|
|
25
32
|
resolveEffectiveFunctions: () => resolveEffectiveFunctions,
|
|
26
33
|
resolveEffectiveViewingLevel: () => resolveEffectiveViewingLevel,
|
|
@@ -78,6 +85,28 @@ var PERMISSION_STATE_DISPLAY = {
|
|
|
78
85
|
icon: "\u{1F512}"
|
|
79
86
|
}
|
|
80
87
|
};
|
|
88
|
+
var DEFAULT_BOUND_STATE = {
|
|
89
|
+
...PERMISSION_STATE,
|
|
90
|
+
/** Not relevant — canon's `not_applicable_roles` for this function. */
|
|
91
|
+
NA: "NA"
|
|
92
|
+
};
|
|
93
|
+
var DEFAULT_BOUND_STATE_VALUES = [
|
|
94
|
+
...PERMISSION_STATE_VALUES,
|
|
95
|
+
DEFAULT_BOUND_STATE.NA
|
|
96
|
+
];
|
|
97
|
+
var DEFAULT_BOUND_STATE_LABELS = {
|
|
98
|
+
...PERMISSION_STATE_LABELS,
|
|
99
|
+
[DEFAULT_BOUND_STATE.NA]: "Not relevant"
|
|
100
|
+
};
|
|
101
|
+
var DEFAULT_BOUND_STATE_DISPLAY = {
|
|
102
|
+
...PERMISSION_STATE_DISPLAY,
|
|
103
|
+
[DEFAULT_BOUND_STATE.NA]: {
|
|
104
|
+
label: "Not relevant",
|
|
105
|
+
color: "#616161",
|
|
106
|
+
bgColor: "#f5f5f5",
|
|
107
|
+
icon: "\u25CC"
|
|
108
|
+
}
|
|
109
|
+
};
|
|
81
110
|
var SHARE_VIEW = {
|
|
82
111
|
/** System metadata only (partial access). */
|
|
83
112
|
SYS_INFO: "sys_info",
|
|
@@ -404,11 +433,9 @@ var STATES = new Set(Object.values(PERMISSION_STATE));
|
|
|
404
433
|
function readState(map, code) {
|
|
405
434
|
const v = own(map, code);
|
|
406
435
|
if (v === void 0 || v === null) return void 0;
|
|
436
|
+
if (v === DEFAULT_BOUND_STATE.NA) return PERMISSION_STATE.NEVER;
|
|
407
437
|
return typeof v === "string" && STATES.has(v) ? v : "malformed";
|
|
408
438
|
}
|
|
409
|
-
function stringList(v) {
|
|
410
|
-
return Array.isArray(v) ? v.filter((x) => typeof x === "string") : [];
|
|
411
|
-
}
|
|
412
439
|
function teamValueRestricts(map, code) {
|
|
413
440
|
const gate = readState(map, code);
|
|
414
441
|
return gate !== void 0 && gate !== PERMISSION_STATE.PREF_YES && gate !== PERMISSION_STATE.ALWAYS;
|
|
@@ -481,31 +508,30 @@ function resolveEffectiveFunctions(input) {
|
|
|
481
508
|
const retired = own(fn, "retired");
|
|
482
509
|
if (typeof code !== "string" || !isCanonEvaluableFunction(code)) continue;
|
|
483
510
|
if (retired !== void 0 && retired !== false) continue;
|
|
484
|
-
vocabulary.push(
|
|
511
|
+
vocabulary.push(code);
|
|
485
512
|
}
|
|
486
513
|
const agencyAll = readContainer(input.agencyOverrides);
|
|
487
514
|
const team = compileTeamGate(input.teamPolicy);
|
|
488
515
|
const granted = /* @__PURE__ */ new Set();
|
|
489
516
|
for (const roleCode of heldCodes) {
|
|
490
517
|
const role = rolesByCode.get(roleCode);
|
|
491
|
-
const roleTools = new Set(stringList(own(role, "tools")));
|
|
492
518
|
const roleFunctions = readContainer(own(role, "functions"));
|
|
493
519
|
if (roleFunctions.kind === "malformed") continue;
|
|
494
520
|
const agency = agencyAll.kind === "map" ? readContainer(own(agencyAll.map, roleCode)) : agencyAll;
|
|
495
521
|
for (const fn of vocabulary) {
|
|
496
|
-
if (granted.has(fn
|
|
497
|
-
const listed = roleFunctions.kind === "map" ? readState(roleFunctions.map, fn
|
|
498
|
-
|
|
499
|
-
const tier1 = listed === "malformed" ? PERMISSION_STATE.NEVER : listed
|
|
522
|
+
if (granted.has(fn)) continue;
|
|
523
|
+
const listed = roleFunctions.kind === "map" ? readState(roleFunctions.map, fn) : void 0;
|
|
524
|
+
if (listed === void 0) continue;
|
|
525
|
+
const tier1 = listed === "malformed" ? PERMISSION_STATE.NEVER : listed;
|
|
500
526
|
let state = tier1;
|
|
501
527
|
if (tier1 !== PERMISSION_STATE.ALWAYS && tier1 !== PERMISSION_STATE.NEVER) {
|
|
502
|
-
const override = agency.kind === "malformed" ? "malformed" : agency.kind === "map" ? readState(agency.map, fn
|
|
528
|
+
const override = agency.kind === "malformed" ? "malformed" : agency.kind === "map" ? readState(agency.map, fn) : void 0;
|
|
503
529
|
if (override === "malformed") state = PERMISSION_STATE.NEVER;
|
|
504
530
|
else if (override !== void 0) state = override;
|
|
505
531
|
}
|
|
506
532
|
if (state !== PERMISSION_STATE.ALWAYS && state !== PERMISSION_STATE.PREF_YES) continue;
|
|
507
|
-
if (state !== PERMISSION_STATE.ALWAYS && teamRestricts(team, roleCode, fn
|
|
508
|
-
granted.add(fn
|
|
533
|
+
if (state !== PERMISSION_STATE.ALWAYS && teamRestricts(team, roleCode, fn)) continue;
|
|
534
|
+
granted.add(fn);
|
|
509
535
|
}
|
|
510
536
|
}
|
|
511
537
|
return [...granted].sort();
|
|
@@ -527,9 +553,114 @@ function viewingLevelFromFunctions(effectiveFunctions, teamViewingLevel) {
|
|
|
527
553
|
function resolveEffectiveViewingLevel(input, teamViewingLevel) {
|
|
528
554
|
return viewingLevelFromFunctions(resolveEffectiveFunctions(input), teamViewingLevel);
|
|
529
555
|
}
|
|
556
|
+
|
|
557
|
+
// src/generated/coreFunctionDefaultBounds.ts
|
|
558
|
+
var CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION = "1.3.0";
|
|
559
|
+
var CORE_FUNCTION_DEFAULT_BOUNDS = {
|
|
560
|
+
"agency_info_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "TEAM-ADM": "PREF_YES" },
|
|
561
|
+
"announcement_publish": { "MEM-ADM": "PREF_NO", "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
562
|
+
"api_key_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "NEVER", "case_nav": "NA", "research_analytics": "NA" },
|
|
563
|
+
"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" },
|
|
564
|
+
"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" },
|
|
565
|
+
"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" },
|
|
566
|
+
"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" },
|
|
567
|
+
"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" },
|
|
568
|
+
"case_collaborator_add": { "case_nav": "NA", "investigator": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA" },
|
|
569
|
+
"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" },
|
|
570
|
+
"case_reopen": { "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "investigator": "ALWAYS", "le_liaison_vsp": "NEVER", "research_analytics": "NA", "screener": "NEVER", "volunteer": "PREF_NO" },
|
|
571
|
+
"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" },
|
|
572
|
+
"case_status_manage": { "SUP": "PREF_YES", "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
573
|
+
"case_transfer_bulk": { "MEM-ADM": "PREF_YES", "PLT-ADM": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "PREF_NO", "research_analytics": "NA" },
|
|
574
|
+
"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" },
|
|
575
|
+
"case_visibility_manage": { "MEM-ADM": "ALWAYS", "SUP": "ALWAYS", "case_nav": "NA", "intel_analyst": "PREF_NO", "investigator": "ALWAYS", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
576
|
+
"ci_periodic_review": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
577
|
+
"ci_record_purge_or_retire": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
578
|
+
"ci_record_validate": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
579
|
+
"ci_to_evidence_export_authorize": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
580
|
+
"deconfliction_alert_acknowledge": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
581
|
+
"deconfliction_unmask": { "case_nav": "NA", "intel_analyst": "PREF_YES", "investigator": "ALWAYS", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
582
|
+
"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" },
|
|
583
|
+
"disclose_external_request": { "CIRO": "PREF_YES", "PLT-ADM": "ALWAYS", "case_nav": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS" },
|
|
584
|
+
"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" },
|
|
585
|
+
"exit_discharge_conduct": { "case_nav": "ALWAYS", "crisis_response": "PREF_NO", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "NEVER", "volunteer": "NEVER" },
|
|
586
|
+
"export_deidentified": { "DATA-ADM": "PREF_YES", "PLT-ADM": "ALWAYS", "research_analytics": "PREF_YES" },
|
|
587
|
+
"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" },
|
|
588
|
+
"idb_record_create": { "PLT-ADM": "ALWAYS", "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
589
|
+
"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" },
|
|
590
|
+
"investigation_create_claim": { "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
591
|
+
"investigation_session_run": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "PREF_YES", "research_analytics": "NA" },
|
|
592
|
+
"investigative_database_search": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
593
|
+
"investigative_request_send": { "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
594
|
+
"lead_create": { "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
595
|
+
"lead_publish": { "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
596
|
+
"lead_route_assign": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
597
|
+
"lead_triage_manage": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
598
|
+
"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" },
|
|
599
|
+
"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" },
|
|
600
|
+
"member_account_report_generate": { "DATA-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "research_analytics": "PREF_YES" },
|
|
601
|
+
"member_onboarding_support": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "research_analytics": "NA" },
|
|
602
|
+
"message_moderate": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS" },
|
|
603
|
+
"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" },
|
|
604
|
+
"milestone_log": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
605
|
+
"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" },
|
|
606
|
+
"network_corpus_access": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
607
|
+
"note_open_departed_author": { "MEM-ADM": "PREF_NO" },
|
|
608
|
+
"onboarding_config_sign_off": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS" },
|
|
609
|
+
"open_source_search": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS" },
|
|
610
|
+
"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" },
|
|
611
|
+
"person_merge_manage": { "PLT-ADM": "ALWAYS", "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "PREF_YES", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
612
|
+
"platform_perm_modify": { "PLT-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
613
|
+
"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" },
|
|
614
|
+
"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" },
|
|
615
|
+
"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" },
|
|
616
|
+
"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" },
|
|
617
|
+
"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" },
|
|
618
|
+
"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" },
|
|
619
|
+
"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" },
|
|
620
|
+
"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" },
|
|
621
|
+
"role_assign": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NA", "TEAM-ADM": "PREF_NO", "research_analytics": "NA" },
|
|
622
|
+
"roles_accounts_toggle": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS" },
|
|
623
|
+
"sandbox_environment_manage": { "PLT-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
624
|
+
"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" },
|
|
625
|
+
"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" },
|
|
626
|
+
"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" },
|
|
627
|
+
"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" },
|
|
628
|
+
"share_config": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "PREF_YES", "SUP": "NEVER", "TEAM-ADM": "NEVER", "research_analytics": "NA" },
|
|
629
|
+
"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" },
|
|
630
|
+
"share_rule_approve_cross_agency": { "GOV-AUD": "PREF_YES", "PLT-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
631
|
+
"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" },
|
|
632
|
+
"srl_manage": { "DATA-ADM": "PREF_YES", "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "TEAM-ADM": "PREF_YES" },
|
|
633
|
+
"supervisee_thread_view": { "PLT-ADM": "ALWAYS", "SUP": "ALWAYS", "TEAM-ADM": "PREF_YES", "case_nav": "NA" },
|
|
634
|
+
"support_ticket_triage": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
635
|
+
"system_diagnostics_view": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
636
|
+
"team_config_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "NEVER", "research_analytics": "NA" },
|
|
637
|
+
"team_membership_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NA", "TEAM-ADM": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
638
|
+
"team_share_narrowing": { "MEM-ADM": "ALWAYS", "SUP": "PREF_NO", "TEAM-ADM": "PREF_YES", "research_analytics": "NA" },
|
|
639
|
+
"team_workflow_config_manage": { "MEM-ADM": "ALWAYS", "TEAM-ADM": "PREF_YES", "research_analytics": "NA" },
|
|
640
|
+
"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" },
|
|
641
|
+
"usr_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "PREF_NO", "research_analytics": "NA" },
|
|
642
|
+
"viewing_config_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "PREF_YES" },
|
|
643
|
+
"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" },
|
|
644
|
+
"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" },
|
|
645
|
+
"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" }
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
// src/authz/defaultBounds.ts
|
|
649
|
+
function codebookDefaultBound(functionCode, roleCode) {
|
|
650
|
+
if (!Object.hasOwn(CORE_FUNCTION_DEFAULT_BOUNDS, functionCode)) return null;
|
|
651
|
+
const roles = CORE_FUNCTION_DEFAULT_BOUNDS[functionCode];
|
|
652
|
+
return Object.hasOwn(roles, roleCode) ? roles[roleCode] : null;
|
|
653
|
+
}
|
|
530
654
|
// Annotate the CommonJS export names for ESM import in node:
|
|
531
655
|
0 && (module.exports = {
|
|
656
|
+
CORE_FUNCTION_DEFAULT_BOUNDS,
|
|
657
|
+
CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION,
|
|
658
|
+
DEFAULT_BOUND_STATE,
|
|
659
|
+
DEFAULT_BOUND_STATE_DISPLAY,
|
|
660
|
+
DEFAULT_BOUND_STATE_LABELS,
|
|
661
|
+
DEFAULT_BOUND_STATE_VALUES,
|
|
532
662
|
VIEWING_LEVEL_FUNCTIONS,
|
|
663
|
+
codebookDefaultBound,
|
|
533
664
|
isCanonEvaluableFunction,
|
|
534
665
|
resolveEffectiveFunctions,
|
|
535
666
|
resolveEffectiveViewingLevel,
|