diff options
author | Kishore Reddy, Gujja (kg811t) <kg811t@research.att.com> | 2018-04-17 10:40:38 -0400 |
---|---|---|
committer | Kishore Reddy, Gujja (kg811t) <kg811t@research.att.com> | 2018-04-18 11:35:06 -0400 |
commit | 62cdec31001fa97970548e7e6309efe3adc59772 (patch) | |
tree | 55dce9f74aedb13bedf2082d929be91bd595240e /ecomp-sdk/epsdk-aaf/src/main/java | |
parent | 022fbe9643d663242d7711ce256731120d4263ef (diff) |
pom, new modules changes
Issue-ID: PORTAL-254
portal/SDK release 2.3.0, domain, sdk aaf modules
Change-Id: I05d4b7927fadd85ac1ee33bb64badbc573a837ea
Signed-off-by: Kishore Reddy, Gujja (kg811t) <kg811t@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-aaf/src/main/java')
2 files changed, 10 insertions, 6 deletions
diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java index a0eee23d..d2ccfc2e 100644 --- a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/LoginExternalAuthServiceImpl.java @@ -48,6 +48,8 @@ import java.util.Set; import javax.servlet.http.HttpServletRequest; import org.onap.portalsdk.core.command.LoginBean; +import org.onap.portalsdk.core.domain.Role; +import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.menu.MenuBuilder; import org.onap.portalsdk.core.service.DataAccessService; @@ -55,8 +57,6 @@ import org.onap.portalsdk.core.service.LoginServiceCentralizedImpl; import org.onap.portalsdk.core.util.SystemProperties; import org.onap.portalsdk.core.web.support.AppUtils; import org.onap.portalsdk.core.web.support.UserUtils; -import org.onap.portalsdk.core.domain.Role; -import org.onap.portalsdk.core.domain.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -211,6 +211,7 @@ public class LoginExternalAuthServiceImpl implements LoginExternalAuthService { private User findUser(LoginBean bean, HttpServletRequest request) throws Exception { User user = userApiService.getUser(bean.getUserid(), request); user.setId(getUserIdByOrgUserId(user.getOrgUserId())); + user.setLoginId(bean.getUserid()); logger.debug(EELFLoggerDelegate.debugLogger, "findUser: Returning final user roles and permissions", user.toString()); return user; } diff --git a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java index cecab472..f550b919 100644 --- a/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java +++ b/ecomp-sdk/epsdk-aaf/src/main/java/org/onap/portalsdk/external/authorization/service/UserApiServiceImpl.java @@ -142,10 +142,12 @@ public class UserApiServiceImpl implements UserApiService { && EcompExternalAuthUtils.isJSONValid(role.getString(EcompExternalAuthUtils.EXT_FIELD_DESCRIPTION))) { ExternalRoleDescription desc = mapper.readValue( role.getString(EcompExternalAuthUtils.EXT_FIELD_DESCRIPTION), ExternalRoleDescription.class); - JSONArray perms = role.getJSONArray(EcompExternalAuthUtils.EXT_FIELD_PERMS); - List<ExternalAccessPerms> permsList = mapper.readValue(perms.toString(), TypeFactory - .defaultInstance().constructCollectionType(List.class, ExternalAccessPerms.class)); - desc.setPermissions(permsList); + if(role.has(EcompExternalAuthUtils.EXT_FIELD_PERMS)) { + JSONArray perms = role.getJSONArray(EcompExternalAuthUtils.EXT_FIELD_PERMS); + List<ExternalAccessPerms> permsList = mapper.readValue(perms.toString(), TypeFactory + .defaultInstance().constructCollectionType(List.class, ExternalAccessPerms.class)); + desc.setPermissions(permsList); + } userRoleDetail = new ExternalAccessUserRoleDetail( role.getString(EcompExternalAuthUtils.EXT_ROLE_FIELD_NAME), desc); userRoleDetailList.add(userRoleDetail); @@ -179,6 +181,7 @@ public class UserApiServiceImpl implements UserApiService { postSearchBean.setSearchResult(loadSearchResultData(postSearchBean)); user = (User) postSearchBean.getSearchResult().get(0); user.setActive(true); + user.setLoginId(orgUserId); dataAccessService.saveDomainObject(user, null); } App app = appService.getApp(1l); |