@ministryofjustice/hmpps-prison-permissions-lib 2.4.1 → 2.5.1
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/CHANGELOG.md +12 -0
- package/dist/contractTests/prisonerProfile/scenarios/domains/person/personHealthAndMedication/dietRead/DietReadScenarios.d.ts +2 -0
- package/dist/index.cjs +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +10 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/services/permissions/checks/domains/person/personHealthAndMedication/dietRead/DietReadCheck.d.ts +2 -0
- package/dist/services/permissions/checks/domains/person/personHealthAndMedication/dietRead/DietReadScenarios.d.ts +2 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Please use this to capture reasoning behind changes:
|
|
4
4
|
|
|
5
|
+
## 2.5.1
|
|
6
|
+
|
|
7
|
+
Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.5.0
|
|
10
|
+
|
|
11
|
+
Restricted diet and allergy read access for global search and updated dependencies.
|
|
12
|
+
|
|
13
|
+
## 2.4.1
|
|
14
|
+
|
|
15
|
+
Fixed duplicate record conditional upgrade and updated dependencies.
|
|
16
|
+
|
|
5
17
|
## 2.4.0
|
|
6
18
|
|
|
7
19
|
The Connect DPS team have been supporting a request to make duplicate prisoner records more visible to users.
|
package/dist/index.cjs
CHANGED
|
@@ -1068,6 +1068,15 @@ function personProtectedCharacteristicsCheck(context) {
|
|
|
1068
1068
|
};
|
|
1069
1069
|
}
|
|
1070
1070
|
|
|
1071
|
+
const dietReadCheck = matchBaseCheckAnd({
|
|
1072
|
+
ifRestrictedPatient: (user, prisoner) => isInUsersCaseLoad(prisoner.supportingPrisonId, user)
|
|
1073
|
+
? exports.PermissionCheckStatus.OK
|
|
1074
|
+
: exports.PermissionCheckStatus.RESTRICTED_PATIENT,
|
|
1075
|
+
ifReleasedPrisoner: () => exports.PermissionCheckStatus.PRISONER_IS_RELEASED,
|
|
1076
|
+
ifTransferringPrisoner: () => exports.PermissionCheckStatus.PRISONER_IS_TRANSFERRING,
|
|
1077
|
+
ifPrisonNotInCaseload: () => exports.PermissionCheckStatus.NOT_IN_CASELOAD,
|
|
1078
|
+
});
|
|
1079
|
+
|
|
1071
1080
|
const dietEditCheck = inActiveCaseLoadAndUserHasRole(exports.Role.DietAndAllergiesEdit);
|
|
1072
1081
|
|
|
1073
1082
|
function personHealthAndMedicationCheck(context) {
|
|
@@ -1077,7 +1086,7 @@ function personHealthAndMedicationCheck(context) {
|
|
|
1077
1086
|
...check(exports.PersonHealthAndMedicationPermission.edit_pregnancy, prisonerProfileEditCheck),
|
|
1078
1087
|
...check(exports.PersonHealthAndMedicationPermission.read_smoker, baseCheck),
|
|
1079
1088
|
...check(exports.PersonHealthAndMedicationPermission.edit_smoker, prisonerProfileEditCheck),
|
|
1080
|
-
...check(exports.PersonHealthAndMedicationPermission.read_diet,
|
|
1089
|
+
...check(exports.PersonHealthAndMedicationPermission.read_diet, dietReadCheck),
|
|
1081
1090
|
...check(exports.PersonHealthAndMedicationPermission.edit_diet, dietEditCheck),
|
|
1082
1091
|
};
|
|
1083
1092
|
}
|