From a1c6eff4add57b70b2c22284d08441073ceaa3aa Mon Sep 17 00:00:00 2001 From: Tomek Kaminski Date: Sun, 26 Aug 2018 22:53:28 +0200 Subject: Mapper_2_0 Junits Junits for roles mapping Change-Id: I2d3ffd4b5adef6b164e096fda229d4e1b34be416 Issue-ID: AAF-450 Signed-off-by: Tomek Kaminski --- .../java/org/onap/aaf/auth/service/mapper/Mapper_2_0.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'auth/auth-service/src/main/java/org') diff --git a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/mapper/Mapper_2_0.java b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/mapper/Mapper_2_0.java index 06278f92..f414a9fd 100644 --- a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/mapper/Mapper_2_0.java +++ b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/mapper/Mapper_2_0.java @@ -416,8 +416,7 @@ public class Mapper_2_0 implements Mapper roles(AuthzTrans trans, List from, Roles to, boolean filter) { final boolean needNS = trans.requested(REQD_TYPE.ns); for(RoleDAO.Data frole : from) { - // Only Add Data to view if User is allowed to see this Role - //if(!filter || q.mayUserViewRole(trans, trans.user(), frole).isOK()) { + // Only Add Data to view if User is allowed to see this Role if(!filter || q.mayUser(trans, trans.user(), frole,Access.read).isOK()) { Role role = new Role(); role.setName(frole.ns + '.' + frole.name); @@ -427,7 +426,8 @@ public class Mapper_2_0 implements Mapper rpa = PermDAO.Data.decodeToArray(trans,q,p); - if(rpa.notOK()) return Result.err(rpa); + if(rpa.notOK()) + return Result.err(rpa); String[] pa = rpa.value; Pkey pKey = new Pkey(); @@ -481,12 +481,6 @@ public class Mapper_2_0 implements Mapper userRole(AuthzTrans trans, Request base) { try { @@ -495,8 +489,7 @@ public class Mapper_2_0 implements Mapper