summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java
diff options
context:
space:
mode:
authorChristopher Lott (cl778h) <clott@research.att.com>2017-07-07 07:21:10 -0400
committerChristopher Lott (cl778h) <clott@research.att.com>2017-07-07 07:22:13 -0400
commit3e7145fc12ed8475ba10bb2a3c63004d41aa42bc (patch)
treec205d84c80e4786708caa705683a56de37c5ed2d /ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java
parent952895873b6179857c6773086a4d2b55f086bd61 (diff)
[PORTAL-25] Role Centralization
Bump EP SDK version to 1.3.0-SNAPSHOT Support Role Centralization & Common Set of Roles across All ONAP On-Boarded Applications Change-Id: Icfc1bbfddaf2c7c7176b4cf7bb7017d853c63100 Signed-off-by: Christopher Lott (cl778h) <clott@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java')
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java b/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java
index 02d35ae9..01337f78 100644
--- a/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java
+++ b/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java
@@ -110,7 +110,6 @@ public class PortalRestAPIProxy extends HttpServlet implements IPortalRestAPISer
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
-
if (portalRestApiServiceImpl == null) {
// Should never happen due to checks in init()
logger.error("doPost: no service class instance");
@@ -145,7 +144,7 @@ public class PortalRestAPIProxy extends HttpServlet implements IPortalRestAPISer
bodyMap.put("userid", userId);
requestBody = mapper.writeValueAsString(bodyMap);
responseJson = RestWebServiceClient.getInstance().postPortalContent(storeAnalyticsContextPath,
- userId, credential, null, credential, credential, "application/json", requestBody);
+ userId, credential, null, credential, credential, "application/json", requestBody, true);
if (logger.isDebugEnabled())
logger.debug("doPost: postPortalContent returns " + responseJson);
response.setStatus(HttpServletResponse.SC_OK);
@@ -321,8 +320,9 @@ public class PortalRestAPIProxy extends HttpServlet implements IPortalRestAPISer
String credential = PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY);
// for now lets also pass uebkey as user name and password
contentType = "text/javascript";
+
responseString = RestWebServiceClient.getInstance().getPortalContent(webAnalyticsContextPath,
- userId, credential, null, credential, credential);
+ userId, credential, null, credential, credential,true);
if (logger.isDebugEnabled())
logger.debug("doGet: " + webAnalyticsContextPath + ": " + responseString);
response.setStatus(HttpServletResponse.SC_OK);
@@ -398,9 +398,10 @@ public class PortalRestAPIProxy extends HttpServlet implements IPortalRestAPISer
}
} else
// Example: /roles <-- get all roles
+
if (requestUri.endsWith(PortalApiConstants.API_PREFIX + "/roles")) {
try {
- List<EcompRole> roles = getAvailableRoles();
+ List<EcompRole> roles = getAvailableRoles(getUserId(request));
responseJson = mapper.writeValueAsString(roles);
if (logger.isDebugEnabled())
logger.debug("doGet: getAvailableRoles: " + responseJson);
@@ -484,8 +485,8 @@ public class PortalRestAPIProxy extends HttpServlet implements IPortalRestAPISer
}
@Override
- public List<EcompRole> getAvailableRoles() throws PortalAPIException {
- return portalRestApiServiceImpl.getAvailableRoles();
+ public List<EcompRole> getAvailableRoles(String requestedLoginId) throws PortalAPIException {
+ return portalRestApiServiceImpl.getAvailableRoles(requestedLoginId);
}
@Override