-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
…ing groupPriv import
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,8 +184,9 @@ public void savePrivileges(GroupPrivilegeContractWeb[] requests, Organisation or | |
List<Group> groups = groupRepository.findAll(); | ||
|
||
Arrays.stream(requests).filter(grpPrivyConWebRequest -> !grpPrivyConWebRequest.isVoided()).forEach(request -> { | ||
Group targetedGroup = getGroup(request, organisation, groups); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
himeshr
Author
Contributor
|
||
GroupPrivilege groupPrivilege = groupPrivileges.stream().filter(gp -> | ||
Objects.equals(request.getGroupUUID(), gp.getGroupUuid()) | ||
Objects.equals(targetedGroup.getUuid(), gp.getGroupUuid()) | ||
This comment has been minimized.
Sorry, something went wrong.
mahalakshme
Contributor
|
||
&& Objects.equals(request.getPrivilegeUUID(), gp.getPrivilegeUuid()) | ||
&& Objects.equals(request.getSubjectTypeUUID(), gp.getSubjectTypeUuid()) | ||
&& Objects.equals(request.getProgramUUID(), gp.getProgramUuid()) | ||
|
@@ -203,7 +204,7 @@ public void savePrivileges(GroupPrivilegeContractWeb[] requests, Organisation or | |
groupPrivilege.setEncounterType(CollectionUtil.findByUuid(encounterTypes, request.getEncounterTypeUUID())); | ||
groupPrivilege.setProgramEncounterType(CollectionUtil.findByUuid(encounterTypes, request.getProgramEncounterTypeUUID())); | ||
groupPrivilege.setChecklistDetail(CollectionUtil.findByUuid(checklistDetails, request.getChecklistDetailUUID())); | ||
groupPrivilege.setGroup(getGroup(request, organisation, groups)); | ||
groupPrivilege.setGroup(targetedGroup); | ||
} | ||
|
||
groupPrivilege.setAllow(request.isAllow()); | ||
|
@himeshr In getGroup we are checking only Everyone. It would be the same case for administrator group as well right? Looks like getGroup returns null as well - but that will not happen no? If it happens, it can lead to null pointer exception.