@hmcts/rpx-xui-common-lib 3.2.11 → 3.2.12-multiple-role-categories
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.
|
@@ -2398,6 +2398,8 @@ class FindAPersonService {
|
|
|
2398
2398
|
constructor(http, sessionStorageService) {
|
|
2399
2399
|
this.http = http;
|
|
2400
2400
|
this.sessionStorageService = sessionStorageService;
|
|
2401
|
+
// userId set as empty string as there is no exists check and was type warning
|
|
2402
|
+
this.userId = '';
|
|
2401
2403
|
this.assignedUser = [];
|
|
2402
2404
|
}
|
|
2403
2405
|
find(searchOptions) {
|
|
@@ -2434,10 +2436,12 @@ class FindAPersonService {
|
|
|
2434
2436
|
email: caseworker.email,
|
|
2435
2437
|
name: `${caseworker.firstName} ${caseworker.lastName}`,
|
|
2436
2438
|
id: caseworker.idamId,
|
|
2437
|
-
|
|
2439
|
+
// EXUI-4758 - If user has admin role, set domain to admin
|
|
2440
|
+
// For more specific domain we need service specific role category (or other technique)
|
|
2441
|
+
domain: this.setDomain(caseworker)
|
|
2438
2442
|
// knownAs can be added if required
|
|
2439
2443
|
};
|
|
2440
|
-
if (caseworker.roleCategory
|
|
2444
|
+
if (caseworker.roleCategories.includes(roleCategory) || roleCategory === RoleCategory.ALL || caseworker.idamId === this.userId) {
|
|
2441
2445
|
people.push(thisPerson);
|
|
2442
2446
|
}
|
|
2443
2447
|
});
|
|
@@ -2467,6 +2471,20 @@ class FindAPersonService {
|
|
|
2467
2471
|
searchJudicial(value, serviceId) {
|
|
2468
2472
|
return this.http.post('api/prd/judicial/getJudicialUsersSearch', { searchString: value, serviceCode: serviceId });
|
|
2469
2473
|
}
|
|
2474
|
+
// Note: Domain only used internally to set the PersonRole for the Person object
|
|
2475
|
+
setDomain(caseworker) {
|
|
2476
|
+
if (caseworker.roleCategories.includes(RoleCategory.ADMIN)) {
|
|
2477
|
+
return PersonRole.ADMIN;
|
|
2478
|
+
}
|
|
2479
|
+
if (caseworker.roleCategories.includes(RoleCategory.CTSC)) {
|
|
2480
|
+
return PersonRole.CTSC;
|
|
2481
|
+
}
|
|
2482
|
+
if (caseworker.roleCategories.includes(RoleCategory.LEGAL_OPERATIONS)) {
|
|
2483
|
+
return PersonRole.LEGAL_OPERATIONS;
|
|
2484
|
+
}
|
|
2485
|
+
// return default role if no match found
|
|
2486
|
+
return PersonRole.LEGAL_OPERATIONS;
|
|
2487
|
+
}
|
|
2470
2488
|
static { this.ɵfac = function FindAPersonService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FindAPersonService)(i0.ɵɵinject(i1$2.HttpClient), i0.ɵɵinject(SessionStorageService)); }; }
|
|
2471
2489
|
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FindAPersonService, factory: FindAPersonService.ɵfac, providedIn: 'root' }); }
|
|
2472
2490
|
}
|