Adding User Auth and permission aaf services 23/59523/1
authorKishore Reddy, Gujja (kg811t) <kg811t@research.att.com>
Tue, 7 Aug 2018 21:08:55 +0000 (17:08 -0400)
committerKishore Reddy, Gujja (kg811t) <kg811t@research.att.com>
Tue, 7 Aug 2018 21:08:55 +0000 (17:08 -0400)
Issue-ID: PORTAL-334

Change-Id: Iee2e7e6a2e944ed60708a81c706977628d84ac39
Signed-off-by: Kishore Reddy, Gujja (kg811t) <kg811t@research.att.com>
ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java

index bfe9808..3eac97b 100644 (file)
@@ -128,7 +128,7 @@ public class UserApiServiceImpl implements UserApiService {
                                        HttpMethod.GET, entity, String.class);
                        if (getResponse.getStatusCode().value() == 200) {
                                logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "getUserRoles: Finished GET unp ser roles from external auth system and body: {}",
+                                               "getUserRoles: Finished GET user app roles from external auth system and body: {}",
                                                getResponse.getBody());
                        }
                        String userRoles = getResponse.getBody();
@@ -162,9 +162,7 @@ public class UserApiServiceImpl implements UserApiService {
                                if (!role.getString(EcompExternalAuthUtils.EXT_ROLE_FIELD_NAME)
                                                .endsWith(EcompExternalAuthUtils.EXT_ROLE_FIELD_ADMIN)
                                                && !role.getString(EcompExternalAuthUtils.EXT_ROLE_FIELD_NAME)
-                                                               .endsWith(EcompExternalAuthUtils.EXT_ROLE_FIELD_OWNER)
-                                               && EcompExternalAuthUtils.checkNameSpaceMatching(
-                                                               role.getString(EcompExternalAuthUtils.EXT_ROLE_FIELD_NAME), namespace)) {
+                                                               .endsWith(EcompExternalAuthUtils.EXT_ROLE_FIELD_OWNER)) {
                                        ExternalRoleDescription desc = new ExternalRoleDescription();
                                        if (role.has(EcompExternalAuthUtils.EXT_FIELD_DESCRIPTION) && EcompExternalAuthUtils
                                                        .isJSONValid(role.getString(EcompExternalAuthUtils.EXT_FIELD_DESCRIPTION))) {
@@ -225,7 +223,7 @@ public class UserApiServiceImpl implements UserApiService {
                        if (roleDesc != null) {
                                if (roleDesc.getName() == null) {
                                        role.setActive(true);
-                                       role.setName(userRoleDetail.getName().substring(namespace.length() + 1));
+                                       role.setName(userRoleDetail.getName());
                                } else {
                                        role.setActive(Boolean.valueOf(roleDesc.getActive()));
                                        role.setId(Long.valueOf(roleDesc.getAppRoleId()));