@ministryofjustice/hmpps-prison-permissions-lib 2.0.1 → 2.1.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 CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Please use this to capture reasoning behind changes:
4
4
 
5
+ # 2.1.0
6
+ Adds the sensitive edits role to the edit_contacts permission so users can edit Next of Kin and Emergency contacts in the prisoner profile without requiring Contacts Administrator or Authoriser roles.
7
+
5
8
  # 2.0.1
6
9
  Fixes incorrect usage of `previousPrisonId` and `previousPrisonLeavingDate` when checking contacts read permissions. These are only used in the context of transfers, not releases. The correct ones now in use are `lastPrisonId` and `releaseDate`.
7
10
 
package/dist/index.cjs CHANGED
@@ -776,7 +776,11 @@ function personalRelationshipsCheck(context) {
776
776
  ...check(exports.PersonalRelationshipsPermission.read_emergency_contacts, baseCheck),
777
777
  ...check(exports.PersonalRelationshipsPermission.edit_emergency_contacts, prisonerProfileSensitiveEditCheck),
778
778
  ...check(exports.PersonalRelationshipsPermission.read_contacts, contactsReadCheck),
779
- ...check(exports.PersonalRelationshipsPermission.edit_contacts, inUsersCaseLoadAndUserHasSomeRolesFrom([exports.Role.ContactsAdministrator, exports.Role.ContactsAuthoriser])),
779
+ ...check(exports.PersonalRelationshipsPermission.edit_contacts, inUsersCaseLoadAndUserHasSomeRolesFrom([
780
+ exports.Role.ContactsAdministrator,
781
+ exports.Role.ContactsAuthoriser,
782
+ exports.Role.PrisonerProfileSensitiveEdit,
783
+ ])),
780
784
  ...check(exports.PersonalRelationshipsPermission.edit_contact_restrictions, inUsersCaseLoadAndUserHasRole(exports.Role.ContactsAuthoriser)),
781
785
  ...check(exports.PersonalRelationshipsPermission.edit_contact_visit_approval, inUsersCaseLoadAndUserHasRole(exports.Role.ContactsAuthoriser)),
782
786
  };