summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi')
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/IPortalRestAPIService.java4
-rw-r--r--ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/PortalRestAPIProxy.java13
2 files changed, 10 insertions, 7 deletions
diff --git a/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/IPortalRestAPIService.java b/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/IPortalRestAPIService.java
index 0efd1ce4..b2d5ef3d 100644
--- a/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/IPortalRestAPIService.java
+++ b/ecomp-sdk/epsdk-fw/src/main/java/org/openecomp/portalsdk/core/onboarding/crossapi/IPortalRestAPIService.java
@@ -102,11 +102,13 @@ public interface IPortalRestAPIService {
* library will catch the exception and send an appropriate response to
* Portal.
*
+ * @param requestedLoginId
+ * requested userloginId to fetch available roles
* @return List of role attribute objects; empty list if none are found.
* @throws PortalAPIException
* If an unexpected error occurs while processing the request.
*/
- public List<EcompRole> getAvailableRoles() throws PortalAPIException;
+ public List<EcompRole> getAvailableRoles(String requestedLoginId) throws PortalAPIException;
/**
* Updates roles for the user with the specified loginId to the list of
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