diff --git a/backend/src/main/java/org/eclipse/tractusx/valueaddedservice/dto/AuthPropertiesDTO.java b/backend/src/main/java/org/eclipse/tractusx/valueaddedservice/dto/AuthPropertiesDTO.java index 96ab2ef..02bb63e 100644 --- a/backend/src/main/java/org/eclipse/tractusx/valueaddedservice/dto/AuthPropertiesDTO.java +++ b/backend/src/main/java/org/eclipse/tractusx/valueaddedservice/dto/AuthPropertiesDTO.java @@ -82,7 +82,11 @@ public List getRoles(String clientId){ LinkedHashMap list = (LinkedHashMap) resourceAccess; LinkedHashMap clientResources = list.get(clientId) != null ? (LinkedHashMap) list.get(clientId):new LinkedHashMap(); List rolesList = clientResources.get("roles") != null ? (List) clientResources.get("roles"):new ArrayList<>(); - this.isAdmin = rolesList.contains(VasConstants.CSV_ROLE_COMPANY_ADMIN); + + this.isAdmin = rolesList.stream() + .map(String::trim) + .anyMatch(role -> role.equals(VasConstants.CSV_ROLE_COMPANY_ADMIN)); + return rolesList; }