X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=portal-BE%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportal%2Futils%2FEPUserUtils.java;h=968e64f4d38d3c3e91d47cc0ad1d1f78f164c22e;hb=refs%2Fchanges%2F01%2F98501%2F2;hp=b72a8297792003d2f3b431871c41050915d02718;hpb=fadf5206f07dada8b60b8ee5923cb33de90dbe5b;p=portal.git diff --git a/portal-BE/src/main/java/org/onap/portal/utils/EPUserUtils.java b/portal-BE/src/main/java/org/onap/portal/utils/EPUserUtils.java index b72a8297..968e64f4 100644 --- a/portal-BE/src/main/java/org/onap/portal/utils/EPUserUtils.java +++ b/portal-BE/src/main/java/org/onap/portal/utils/EPUserUtils.java @@ -58,6 +58,7 @@ import lombok.NoArgsConstructor; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Hex; import org.onap.portal.domain.db.fn.FnRole; +import org.onap.portal.domain.db.fn.FnRoleComposite; import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.domain.db.fn.FnUserRole; import org.onap.portal.exception.RoleFunctionException; @@ -249,7 +250,7 @@ public class EPUserUtils { // Additionally; the account admin role is overloaded between onap // portal and partners; lets also include that - for (FnUserRole epUserApp : user.getFnUserRoles()) { + for (FnUserRole epUserApp : user.getUserApps()) { FnRole role = epUserApp.getRoleId(); if (role.getActiveYn() && role.getRoleId().equals(ACCOUNT_ADMIN_ROLE_ID)) { @@ -272,8 +273,8 @@ public class EPUserUtils { */ @SuppressWarnings({"rawtypes", "unchecked"}) private static void addChildRoles(FnRole role, HashMap roles) { - Set childRoles = role.getFnRoles(); - if (childRoles != null && !childRoles.isEmpty()) { + Set childRoles = role.getChildRoles().stream().map(FnRoleComposite::getChildRoles).collect(Collectors.toSet()); + if (!childRoles.isEmpty()) { for (Object o : childRoles) { FnRole childRole = (FnRole) o; if (childRole.getActiveYn()) {