From: Sunder Tattavarada Date: Thu, 18 Jun 2020 19:46:54 +0000 (+0000) Subject: Merge "fixed some issues from sonar" X-Git-Tag: 3.4.0~52 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=c2ebd5a44d02a2c7b38bda521b961f488e26bbfa;hp=-c;p=portal.git Merge "fixed some issues from sonar" --- c2ebd5a44d02a2c7b38bda521b961f488e26bbfa diff --combined ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java index 4d2abb83,ead2ee9b..4b983d8d --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java @@@ -7,10 -7,10 +7,10 @@@ * Modifications Copyright (c) 2019 Samsung * =================================================================== * Modifications Copyright (c) 2020 IBM - * =================================================================== - * + * =================================================================== + * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the "License"); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@@ -97,10 -97,8 +97,8 @@@ import org.springframework.context.anno import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; - import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.GetMapping; - import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import com.fasterxml.jackson.databind.DeserializationFeature; @@@ -166,7 -164,7 +164,7 @@@ public class RoleManageController exten EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getRolesInAAF()) { List answer = null; Map model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); @@@ -244,7 -242,7 +242,7 @@@ requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getRolesInAAF()) { externalRequestFieldsValidator = externalAccessRolesService.deleteDependencyRoleRecord(roleId, requestedApp.getUebKey(), user.getOrgUserId()); boolean deleteResponse = externalRequestFieldsValidator.isResult(); @@@ -307,7 -305,7 +305,7 @@@ EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp != null && requestedApp.getCentralAuth().equals(true)) { + if (requestedApp != null && requestedApp.getRolesInAAF().equals(true)) { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); JsonNode root = mapper.readTree(request.getReader()); @@@ -450,7 -448,7 +448,7 @@@ EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getRolesInAAF()) { CentralV2Role answer = externalAccessRolesService.getRoleInfo(roleId, requestedApp.getUebKey()); logger.info(EELFLoggerDelegate.applicationLogger, "role_id" + roleId); Map model = new HashMap<>(); @@@ -483,7 -481,7 +481,7 @@@ EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getRolesInAAF()) { List answer = null; Map model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); @@@ -525,7 -523,7 +523,7 @@@ EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth() && roleFunc!=null) { + if (requestedApp.getRolesInAAF() && roleFunc!=null) { String code = roleFunc.getType() + PIPE + roleFunc.getCode() + PIPE + roleFunc.getAction(); CentralV2RoleFunction domainRoleFunction = externalAccessRolesService.getRoleFunction(code, requestedApp.getUebKey()); @@@ -624,7 -622,7 +622,7 @@@ EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getRolesInAAF()) { ObjectMapper mapper = new ObjectMapper(); String data = roleFunc; boolean getDelFuncResponse = false; @@@ -811,7 -809,7 +809,7 @@@ throw new InvalidApplicationException("Invalid credentials"); } if (!appInfo.isEmpty() && EcompPortalUtils.checkIfRemoteCentralAccessAllowed() - && appInfo.get(0).getCentralAuth()) { + && appInfo.get(0).getRolesInAAF()) { ResponseEntity response = externalAccessRolesService.getNameSpaceIfExists(appInfo.get(0)); if (response.getStatusCode().value() == HttpServletResponse.SC_NOT_FOUND) throw new InvalidApplicationException("Invalid NameSpace");