@@ -184,8 +184,9 @@ public void savePrivileges(GroupPrivilegeContractWeb[] requests, Organisation or
184
184
List <Group > groups = groupRepository .findAll ();
185
185
186
186
Arrays .stream (requests ).filter (grpPrivyConWebRequest -> !grpPrivyConWebRequest .isVoided ()).forEach (request -> {
187
+ Group targetedGroup = getGroup (request , organisation , groups );
187
188
GroupPrivilege groupPrivilege = groupPrivileges .stream ().filter (gp ->
188
- Objects .equals (request . getGroupUUID (), gp .getGroupUuid ())
189
+ Objects .equals (targetedGroup . getUuid (), gp .getGroupUuid ())
189
190
&& Objects .equals (request .getPrivilegeUUID (), gp .getPrivilegeUuid ())
190
191
&& Objects .equals (request .getSubjectTypeUUID (), gp .getSubjectTypeUuid ())
191
192
&& Objects .equals (request .getProgramUUID (), gp .getProgramUuid ())
@@ -203,7 +204,7 @@ public void savePrivileges(GroupPrivilegeContractWeb[] requests, Organisation or
203
204
groupPrivilege .setEncounterType (CollectionUtil .findByUuid (encounterTypes , request .getEncounterTypeUUID ()));
204
205
groupPrivilege .setProgramEncounterType (CollectionUtil .findByUuid (encounterTypes , request .getProgramEncounterTypeUUID ()));
205
206
groupPrivilege .setChecklistDetail (CollectionUtil .findByUuid (checklistDetails , request .getChecklistDetailUUID ()));
206
- groupPrivilege .setGroup (getGroup ( request , organisation , groups ) );
207
+ groupPrivilege .setGroup (targetedGroup );
207
208
}
208
209
209
210
groupPrivilege .setAllow (request .isAllow ());
0 commit comments