use of edu.internet2.middleware.grouperClient.ws.beans.WsGetAttributeAssignmentsResults in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupingAssignmentServiceImpl method groupingsOpted.
// returns a list of groupings corresponding to the include group orr exclude group (includeOrrExclude) in groupPaths that
// have the self-opted attribute set in the membership
public List<Grouping> groupingsOpted(String includeOrrExclude, String username, List<String> groupPaths) {
logger.info("groupingsOpted; includeOrrExclude: " + includeOrrExclude + "; username: " + username + ";");
List<String> groupingsOpted = new ArrayList<>();
List<String> groupsOpted = groupPaths.stream().filter(group -> group.endsWith(includeOrrExclude) && memberAttributeService.isSelfOpted(group, username)).map(helperService::parentGroupingPath).collect(Collectors.toList());
if (groupsOpted.size() > 0) {
List<WsGetAttributeAssignmentsResults> attributeAssignmentsResults = grouperFS.makeWsGetAttributeAssignmentsResultsTrio(ASSIGN_TYPE_GROUP, TRIO, groupsOpted);
List<WsGroup> triosList = new ArrayList<>();
for (WsGetAttributeAssignmentsResults results : attributeAssignmentsResults) {
triosList.addAll(Arrays.asList(results.getWsGroups()));
}
groupingsOpted.addAll(triosList.stream().map(WsGroup::getName).collect(Collectors.toList()));
}
return helperService.makeGroupings(groupingsOpted);
}
Aggregations