Code Review
/
portal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Domain model change
[portal.git]
/
portal-BE
/
src
/
main
/
java
/
org
/
onap
/
portal
/
utils
/
EPUserUtils.java
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
b72a829
..
fea7133
100644
(file)
--- 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,8
+58,10
@@
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.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.domain.db.fn.FnUser;
import org.onap.portal.domain.db.fn.FnUserRole;
+import org.onap.portal.domain.dto.transport.Role;
import org.onap.portal.exception.RoleFunctionException;
import org.onap.portal.service.fn.old.EPRoleFunctionService;
import org.onap.portalsdk.core.domain.RoleFunction;
import org.onap.portal.exception.RoleFunctionException;
import org.onap.portal.service.fn.old.EPRoleFunctionService;
import org.onap.portalsdk.core.domain.RoleFunction;
@@
-249,10
+251,10
@@
public class EPUserUtils {
// Additionally; the account admin role is overloaded between onap
// portal and partners; lets also include that
// Additionally; the account admin role is overloaded between onap
// portal and partners; lets also include that
- for (FnUserRole epUserApp : user.get
FnUserRole
s()) {
+ for (FnUserRole epUserApp : user.get
UserApp
s()) {
FnRole role = epUserApp.getRoleId();
FnRole role = epUserApp.getRoleId();
- if (role.getActiveYn() && role.get
Role
Id().equals(ACCOUNT_ADMIN_ROLE_ID)) {
+ if (role.getActiveYn() && role.getId().equals(ACCOUNT_ADMIN_ROLE_ID)) {
roles.put(role.getId(), role);
// let's take a recursive trip down the tree to add all child
roles.put(role.getId(), role);
// let's take a recursive trip down the tree to add all child
@@
-272,8
+274,11
@@
public class EPUserUtils {
*/
@SuppressWarnings({"rawtypes", "unchecked"})
private static void addChildRoles(FnRole role, HashMap roles) {
*/
@SuppressWarnings({"rawtypes", "unchecked"})
private static void addChildRoles(FnRole role, HashMap roles) {
- Set<FnRole> childRoles = role.getFnRoles();
- if (childRoles != null && !childRoles.isEmpty()) {
+ List<Role> childRoles = role.getChildRoles()
+ .stream()
+ .map(FnRoleComposite::getChildRoles)
+ .collect(Collectors.toList());
+ if (!childRoles.isEmpty()) {
for (Object o : childRoles) {
FnRole childRole = (FnRole) o;
if (childRole.getActiveYn()) {
for (Object o : childRoles) {
FnRole childRole = (FnRole) o;
if (childRole.getActiveYn()) {