From 4cca7d919292bf0337e5588575b0e3facb88b2de Mon Sep 17 00:00:00 2001 From: janorivera Date: Thu, 12 Dec 2024 16:32:18 -0300 Subject: [PATCH] uscr permissions (#790) --- .../hrm-core/permission-rules/uscr.json | 37 +++++++++++++++++++ hrm-domain/hrm-core/permissions/rulesMap.ts | 2 + hrm-domain/hrm-service/setTestEnvVars.js | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 hrm-domain/hrm-core/permission-rules/uscr.json diff --git a/hrm-domain/hrm-core/permission-rules/uscr.json b/hrm-domain/hrm-core/permission-rules/uscr.json new file mode 100644 index 000000000..159e09fa2 --- /dev/null +++ b/hrm-domain/hrm-core/permission-rules/uscr.json @@ -0,0 +1,37 @@ +{ + "viewCase": [["isSupervisor"], ["isCreator"]], + "closeCase": [["isSupervisor"], ["isCreator", "isCaseOpen"]], + "reopenCase": [["isSupervisor"]], + "caseStatusTransition": [["isSupervisor"], ["isCreator", "isCaseOpen"]], + "addNote": [["isSupervisor"], ["isCreator", "isCaseOpen"]], + "editNote": [["isSupervisor"]], + "addReferral": [["isSupervisor"], ["isCreator", "isCaseOpen"]], + "editReferral": [["isSupervisor"]], + "addHousehold": [["isSupervisor"], ["isCreator", "isCaseOpen"]], + "editHousehold": [["isSupervisor"]], + "addPerpetrator": [["isSupervisor"], ["isCreator", "isCaseOpen"]], + "editPerpetrator": [["isSupervisor"]], + "addIncident": [["isSupervisor"], ["isCreator", "isCaseOpen"]], + "editIncident": [["isSupervisor"]], + "addDocument": [["isSupervisor"], ["isCreator", "isCaseOpen"]], + "editDocument": [["isSupervisor"]], + "editCaseOverview": [["isSupervisor"], ["isCreator", "isCaseOpen"]], + "updateCaseContacts": [["isSupervisor"], ["isCaseOpen"]], + + "viewContact": [["everyone"]], + "editContact": [["isSupervisor"], ["isOwner"]], + "editInProgressContact": [["isSupervisor"], ["isOwner"]], + "viewExternalTranscript": [["everyone"]], + "viewRecording": [], + "addContactToCase": [["isSupervisor"], ["isOwner"]], + "removeContactFromCase": [["isSupervisor"], ["isOwner"]], + + "viewProfile": [["everyone"]], + "flagProfile": [["isSupervisor"]], + "unflagProfile": [["isSupervisor"]], + "viewProfileSection": [["everyone", { "sectionType": "summary" }], ["isSupervisor"]], + "createProfileSection": [["isSupervisor"]], + "editProfileSection": [["isSupervisor"]], + + "viewPostSurvey": [["isSupervisor"]] +} diff --git a/hrm-domain/hrm-core/permissions/rulesMap.ts b/hrm-domain/hrm-core/permissions/rulesMap.ts index 3dbbcdfdd..72121454d 100644 --- a/hrm-domain/hrm-core/permissions/rulesMap.ts +++ b/hrm-domain/hrm-core/permissions/rulesMap.ts @@ -32,6 +32,7 @@ const mwRules = require('../permission-rules/mw.json'); const nzRules = require('../permission-rules/nz.json'); const phRules = require('../permission-rules/ph.json'); const sgRules = require('../permission-rules/sg.json'); +const uscrRules = require('../permission-rules/uscr.json'); const thRules = require('../permission-rules/th.json'); const zaRules = require('../permission-rules/za.json'); const zmRules = require('../permission-rules/zm.json'); @@ -260,6 +261,7 @@ const rulesMapDef = { ph: phRules, sg: sgRules, th: thRules, + uscr: uscrRules, za: zaRules, zm: zmRules, zw: zwRules, diff --git a/hrm-domain/hrm-service/setTestEnvVars.js b/hrm-domain/hrm-service/setTestEnvVars.js index b8321c32f..c25a63f50 100644 --- a/hrm-domain/hrm-service/setTestEnvVars.js +++ b/hrm-domain/hrm-service/setTestEnvVars.js @@ -28,7 +28,7 @@ process.env.PERMISSIONS_ACnz = 'nz'; process.env.PERMISSIONS_ACph = 'ph'; process.env.PERMISSIONS_ACsg = 'sg'; process.env.PERMISSIONS_ACth = 'th'; -process.env.PERMISSIONS_ACuk = 'uk'; +process.env.PERMISSIONS_ACuscr = 'uscr'; process.env.PERMISSIONS_ACza = 'za'; process.env.PERMISSIONS_ACzm = 'zm'; process.env.PERMISSIONS_ACzw = 'zw';