Skip to content

Commit

Permalink
Merge pull request eclipse-tractusx#70 from catenax-ng/main
Browse files Browse the repository at this point in the history
Fix body implementation with edc disabled
  • Loading branch information
SujitMBRDI committed Jan 29, 2024
2 parents 532d136 + f9d66cf commit 8e1d28d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ private List<BusinessPartnerDTO> filterBusinessPartnersByRole(List<BusinessPartn
List<BusinessPartnerDTO> filteredBusinessPartnerDTOS;
log.debug("Roles {}",roles);
log.debug("Code Roles {} {}",CSV_ROLE_READ_SUPPLIER,CSV_ROLE_READ_CUSTOMER);
if (roles.contains(CSV_ROLE_READ_SUPPLIER) && roles.contains(CSV_ROLE_READ_CUSTOMER)) {

if (roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_SUPPLIER)) &&
roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_CUSTOMER))) {
// User has both roles, no need to filter
filteredBusinessPartnerDTOS = businessPartnerDTOS;
} else if (roles.contains(CSV_ROLE_READ_SUPPLIER)) {
} else if (roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_SUPPLIER))) {
// User can only read suppliers and those who are not customers
filteredBusinessPartnerDTOS = filterSuppliers(businessPartnerDTOS);
} else if (roles.contains(CSV_ROLE_READ_CUSTOMER)) {
} else if (roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_CUSTOMER))) {
// User can only read customers and those who are not suppliers
filteredBusinessPartnerDTOS = filterCustomers(businessPartnerDTOS);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private List<BusinessPartnerDTO> handleSequentialRequests() {
private List<BusinessPartnerDTO> handleNonSequentialRequests() {
List<BusinessPartnerDTO> finalDtoList = new ArrayList<>();

String body = "[\"\"]";
String body = "[]";
HttpEntity<Object> httpEntity = createHttpEntity(body);

log.info("Sequential requests not enabled. Starting process to fetch external business partners from generic.");
Expand Down

0 comments on commit 8e1d28d

Please sign in to comment.