2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
20 package org.openecomp.portalapp.portal.controller;
22 import java.util.ArrayList;
23 import java.util.Arrays;
24 import java.util.Collections;
25 import java.util.Comparator;
26 import java.util.List;
28 import javax.servlet.http.HttpServletRequest;
29 import javax.servlet.http.HttpServletResponse;
31 import org.apache.cxf.transport.http.HTTPException;
32 import org.openecomp.portalapp.controller.EPRestrictedBaseController;
33 import org.openecomp.portalapp.portal.domain.EPRole;
34 import org.openecomp.portalapp.portal.domain.EPUser;
35 import org.openecomp.portalapp.portal.domain.EPUserAppCatalogRoles;
36 import org.openecomp.portalapp.portal.domain.EcompAuditLog;
37 import org.openecomp.portalapp.portal.domain.ExternalSystemAccess;
38 import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
39 import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
40 import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
41 import org.openecomp.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
42 import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
43 import org.openecomp.portalapp.portal.service.AdminRolesService;
44 import org.openecomp.portalapp.portal.service.ApplicationsRestClientService;
45 import org.openecomp.portalapp.portal.service.SearchService;
46 import org.openecomp.portalapp.portal.service.UserRolesService;
47 import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
48 import org.openecomp.portalapp.portal.transport.AppWithRolesForUser;
49 import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
50 import org.openecomp.portalapp.portal.transport.FieldsValidator;
51 import org.openecomp.portalapp.portal.transport.RoleInAppForUser;
52 import org.openecomp.portalapp.portal.transport.UserApplicationRoles;
53 import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
54 import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
55 import org.openecomp.portalapp.portal.utils.PortalConstants;
56 import org.openecomp.portalapp.util.EPUserUtils;
57 import org.openecomp.portalsdk.core.domain.AuditLog;
58 import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
59 import org.openecomp.portalsdk.core.restful.domain.EcompRole;
60 import org.openecomp.portalsdk.core.service.AuditService;
61 import org.openecomp.portalsdk.core.util.SystemProperties;
63 import org.springframework.beans.factory.annotation.Autowired;
64 import org.springframework.context.annotation.EnableAspectJAutoProxy;
65 import org.springframework.web.bind.annotation.PathVariable;
66 import org.springframework.web.bind.annotation.RequestBody;
67 import org.springframework.web.bind.annotation.RequestMapping;
68 import org.springframework.web.bind.annotation.RequestMethod;
69 import org.springframework.web.bind.annotation.RequestParam;
70 import org.springframework.web.bind.annotation.RestController;
73 @org.springframework.context.annotation.Configuration
74 @EnableAspectJAutoProxy
76 public class UserRolesController extends EPRestrictedBaseController {
78 private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserRolesController.class);
81 private SearchService searchService;
83 private AdminRolesService adminRolesService;
84 private @Autowired UserRolesService userRolesService;
86 private ApplicationsRestClientService applicationsRestClientService;
88 private AuditService auditService;
90 private static final String FAILURE = "failure";
93 * RESTful service method to fetch users in the WebPhone external service
100 * HttpServletResponse
101 * @return array of found users as json
103 @RequestMapping(value = { "/portalApi/queryUsers" }, method = RequestMethod.GET, produces = "application/json")
104 public String getPhoneBookSearchResult(HttpServletRequest request, @RequestParam("search") String searchString,
105 HttpServletResponse response) {
106 EPUser user = EPUserUtils.getUserSession(request);
107 String searchResult = null;
108 if (!adminRolesService.isSuperAdmin(user) && !adminRolesService.isAccountAdmin(user)) {
109 EcompPortalUtils.setBadPermissions(user, response, "getPhoneBookSearchResult");
111 searchString = searchString.trim();
112 if (searchString.length() > 2) {
113 searchResult = searchService.searchUsersInPhoneBook(searchString);
115 logger.info(EELFLoggerDelegate.errorLogger,
116 "getPhoneBookSearchResult - too short search string: " + searchString);
119 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/queryUsers", "result =", searchResult);
125 * RESTful service method to fetch applications where user is admin
132 * HttpServletResponse
133 * @return for GET: array of all applications with boolean
134 * isAdmin=true/false for each application
136 @RequestMapping(value = { "/portalApi/adminAppsRoles" }, method = {
137 RequestMethod.GET }, produces = "application/json")
138 public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(HttpServletRequest request,
139 @RequestParam("user") String orgUserId, HttpServletResponse response) {
141 EPUser user = EPUserUtils.getUserSession(request);
142 AppsListWithAdminRole result = null;
143 if (!adminRolesService.isSuperAdmin(user)) {
144 EcompPortalUtils.setBadPermissions(user, response, "getAppsWithAdminRoleStateForUser");
146 if (EcompPortalUtils.legitimateUserId(orgUserId)) {
147 result = adminRolesService.getAppsWithAdminRoleStateForUser(orgUserId);
149 logger.info(EELFLoggerDelegate.errorLogger,
150 "getAppsWithAdminRoleStateForUser - parms error, no Organization User ID");
151 response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
155 StringBuilder adminAppRoles = new StringBuilder();
157 if ( result.appsRoles.size() >= 1) {
158 adminAppRoles.append("User '" + result.orgUserId + "' has admin role to the apps = {");
159 for (AppNameIdIsAdmin adminAppRole : result.appsRoles) {
160 if (adminAppRole.isAdmin) {
161 adminAppRoles.append(adminAppRole.appName + ", ");
164 adminAppRoles.append("}.");
166 adminAppRoles.append("User '" + result.orgUserId + "' has no Apps with Admin Role.");
169 logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleStateForUser: getAppsWithAdminRoleStateForUser result is null");
172 logger.info(EELFLoggerDelegate.errorLogger, adminAppRoles.toString());
174 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/adminAppsRoles", "get result =", result);
183 * @param newAppsListWithAdminRoles
186 * HttpServletResponse
187 * @return FieldsValidator
189 @RequestMapping(value = { "/portalApi/adminAppsRoles" }, method = {
190 RequestMethod.PUT }, produces = "application/json")
191 public FieldsValidator putAppsWithAdminRoleStateForUser(HttpServletRequest request,
192 @RequestBody AppsListWithAdminRole newAppsListWithAdminRoles, HttpServletResponse response) {
194 // newAppsListWithAdminRoles.appsRoles
195 FieldsValidator fieldsValidator = new FieldsValidator();
196 StringBuilder newAppRoles = new StringBuilder();
197 if(newAppsListWithAdminRoles != null ){
198 if (newAppsListWithAdminRoles.appsRoles.size() >= 1) {
199 newAppRoles.append("User '" + newAppsListWithAdminRoles.orgUserId + "' has admin role to the apps = { ");
200 for (AppNameIdIsAdmin adminAppRole : newAppsListWithAdminRoles.appsRoles) {
201 if (adminAppRole.isAdmin) {
202 newAppRoles.append(adminAppRole.appName + " ,");
205 newAppRoles.deleteCharAt(newAppRoles.length() - 1);
206 newAppRoles.append("}.");
208 newAppRoles.append("User '" + newAppsListWithAdminRoles.orgUserId + "' has no Apps with Admin Role.");
211 logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleStateForUser: putAppsWithAdminRoleStateForUser result is null");
214 logger.info(EELFLoggerDelegate.errorLogger, newAppRoles.toString());
216 EPUser user = EPUserUtils.getUserSession(request);
217 boolean changesApplied = false;
219 if (!adminRolesService.isSuperAdmin(user)) {
220 EcompPortalUtils.setBadPermissions(user, response, "putAppsWithAdminRoleStateForUser");
222 changesApplied = adminRolesService.setAppsWithAdminRoleStateForUser(newAppsListWithAdminRoles);
223 AuditLog auditLog = new AuditLog();
224 auditLog.setUserId(user.getId());
225 auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN);
226 auditLog.setAffectedRecordId(newAppsListWithAdminRoles.orgUserId);
227 auditLog.setComments(EcompPortalUtils.truncateString(newAppRoles.toString(), PortalConstants.AUDIT_LOG_COMMENT_SIZE));
228 auditService.logActivity(auditLog, null);
230 MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
231 MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
232 EcompPortalUtils.calculateDateTimeDifferenceForLog(
233 MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
234 MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
235 logger.info(EELFLoggerDelegate.auditLogger,
236 EPLogUtil.formatAuditLogMessage("UserRolesController.putAppsWithAdminRoleStateForUser",
237 EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN, user.getOrgUserId(),
238 newAppsListWithAdminRoles.orgUserId, newAppRoles.toString()));
239 MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
240 MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
241 MDC.remove(SystemProperties.MDC_TIMER);
243 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/adminAppsRoles", "put result =", changesApplied);
245 return fieldsValidator;
249 * It returns a list of user app roles for single app
254 * HttpServletResponse
259 * @param extRequestValue
260 * set to false if request is from users page otherwise true
261 * @return List<RoleInAppForUser>
263 @RequestMapping(value = { "/portalApi/userAppRoles" }, method = {
264 RequestMethod.GET }, produces = "application/json")
265 public List<RoleInAppForUser> getAppRolesForUser(HttpServletRequest request, @RequestParam("user") String orgUserId,
266 @RequestParam("app") Long appid, @RequestParam("externalRequest") Boolean extRequestValue,
267 HttpServletResponse response) {
268 EPUser user = EPUserUtils.getUserSession(request);
269 List<RoleInAppForUser> result = null;
270 String feErrorString = "";
271 if (!adminRolesService.isAccountAdmin(user)) {
272 EcompPortalUtils.setBadPermissions(user, response, "getAppRolesForUser");
273 feErrorString = EcompPortalUtils.getFEErrorString(true, response.getStatus());
275 if (EcompPortalUtils.legitimateUserId(orgUserId)) {
276 result = userRolesService.getAppRolesForUser(appid, orgUserId, extRequestValue);
277 int responseCode = EcompPortalUtils.getExternalAppResponseCode();
278 if (responseCode != 0 && responseCode != 200) {
280 response.setStatus(responseCode);
281 feErrorString = EcompPortalUtils.getFEErrorString(false, responseCode);
282 } else if (result == null) {
283 // If the result is null, there was an internal ecomp error
284 // in the service call.
285 response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
286 feErrorString = EcompPortalUtils.getFEErrorString(true,
287 HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
290 logger.info(EELFLoggerDelegate.errorLogger, "getAppRolesForUser - no Organization User ID");
291 response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
292 feErrorString = EcompPortalUtils.getFEErrorString(true, HttpServletResponse.SC_BAD_REQUEST);
296 StringBuilder sbUserApps = new StringBuilder();
297 if (result != null && result.size() >= 1) {
298 sbUserApps.append("User '" + orgUserId + "' has Roles={");
299 for (RoleInAppForUser appRole : result) {
300 if (appRole.isApplied) {
301 sbUserApps.append(appRole.roleName + ", ");
304 sbUserApps.append("} assigned to the appId '" + appid + "'.");
306 // Not sure creating an empty object will make any difference
307 // but would like to give it a shot for defect #DE221057
308 if (result == null) {
309 result = new ArrayList<RoleInAppForUser>();
311 sbUserApps.append("User '" + orgUserId + "' and appid " + appid + " has no roles");
313 logger.info(EELFLoggerDelegate.errorLogger, sbUserApps.toString());
315 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppRoles", "get result =", result);
316 if (feErrorString != "") {
317 logger.debug(EELFLoggerDelegate.debugLogger, "LR: FEErrorString to header: " + feErrorString);
319 response.addHeader("FEErrorString", feErrorString);
320 response.addHeader("Access-Control-Expose-Headers", "FEErrorString");
325 @RequestMapping(value = { "/portalApi/userAppRoles" }, method = {
326 RequestMethod.PUT }, produces = "application/json")
327 public FieldsValidator putAppWithUserRoleStateForUser(HttpServletRequest request,
328 @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) {
329 FieldsValidator fieldsValidator = new FieldsValidator();
330 StringBuilder sbUserApps = new StringBuilder();
331 if (newAppRolesForUser != null) {
332 sbUserApps.append("User '" + newAppRolesForUser.orgUserId);
333 if (newAppRolesForUser.appRoles != null && newAppRolesForUser.appRoles.size() >= 1) {
334 sbUserApps.append("' has roles = { ");
335 for (RoleInAppForUser appRole : newAppRolesForUser.appRoles) {
336 if (appRole.isApplied) {
337 sbUserApps.append(appRole.roleName + " ,");
340 sbUserApps.deleteCharAt(sbUserApps.length() - 1);
341 sbUserApps.append("} assigned for the app " + newAppRolesForUser.appId);
343 sbUserApps.append("' has no roles assigned for app " + newAppRolesForUser.appId);
346 logger.info(EELFLoggerDelegate.applicationLogger, "putAppWithUserRoleStateForUser: {}", sbUserApps.toString());
348 EPUser user = EPUserUtils.getUserSession(request);
349 boolean changesApplied = false;
350 if (!adminRolesService.isAccountAdmin(user)) {
351 EcompPortalUtils.setBadPermissions(user, response, "putAppWithUserRoleStateForUser");
352 } else if(newAppRolesForUser==null){
353 logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleStateForUser: newAppRolesForUser is null");
355 changesApplied = userRolesService.setAppWithUserRoleStateForUser(user, newAppRolesForUser);
356 if (changesApplied) {
357 logger.info(EELFLoggerDelegate.applicationLogger,
358 "putAppWithUserRoleStateForUser: succeeded for app {}, user {}", newAppRolesForUser.appId,
359 newAppRolesForUser.orgUserId);
361 MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
362 AuditLog auditLog = new AuditLog();
363 auditLog.setUserId(user.getId());
364 auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_UPDATE_USER);
365 auditLog.setAffectedRecordId(newAppRolesForUser.orgUserId);
366 auditLog.setComments(EcompPortalUtils.truncateString(sbUserApps.toString(), PortalConstants.AUDIT_LOG_COMMENT_SIZE));
367 auditService.logActivity(auditLog, null);
369 MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
370 EcompPortalUtils.calculateDateTimeDifferenceForLog(
371 MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
372 MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
373 logger.info(EELFLoggerDelegate.auditLogger,
374 EPLogUtil.formatAuditLogMessage("UserRolesController.putAppWithUserRoleStateForUser",
375 EcompAuditLog.CD_ACTIVITY_UPDATE_USER, user.getOrgUserId(),
376 newAppRolesForUser.orgUserId, sbUserApps.toString()));
377 MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
378 MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
379 MDC.remove(SystemProperties.MDC_TIMER);
381 logger.error(EELFLoggerDelegate.errorLogger,
382 "putAppWithUserRoleStateForUser: failed for app {}, user {}", newAppRolesForUser.appId,
383 newAppRolesForUser.orgUserId);
387 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppRoles", "put result =", changesApplied);
388 return fieldsValidator;
391 @RequestMapping(value = { "/portalApi/updateRemoteUserProfile" }, method = {
392 RequestMethod.GET }, produces = "application/json")
393 public PortalRestResponse<String> updateRemoteUserProfile(HttpServletRequest request,
394 HttpServletResponse response) {
396 String updateRemoteUserFlag = FAILURE;
398 // saveNewUser = userService.saveNewUser(newUser);
399 String orgUserId = request.getParameter("loginId");
400 Long appId = Long.parseLong(request.getParameter("appId"));
401 userRolesService.updateRemoteUserProfile(orgUserId, appId);
403 } catch (Exception e) {
404 return new PortalRestResponse<String>(PortalRestStatusEnum.OK, updateRemoteUserFlag, e.getMessage());
406 return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, updateRemoteUserFlag, "");
410 @RequestMapping(value = { "/portalApi/app/{appId}/users" }, method = {
411 RequestMethod.GET }, produces = "application/json")
412 public List<UserApplicationRoles> getUsersFromAppEndpoint(HttpServletRequest request,
413 @PathVariable("appId") Long appId) throws HTTPException {
415 logger.debug(EELFLoggerDelegate.debugLogger, "/portalApi/app/{}/users was invoked", appId);
416 List<UserApplicationRoles> appUsers = userRolesService.getUsersFromAppEndpoint(appId);
418 } catch (Exception e) {
419 logger.error(EELFLoggerDelegate.errorLogger,
420 "Exception occurred while performing UserRolesController.getUsersFromAppEndpoint. Details: "
421 + EcompPortalUtils.getStackTrace(e));
422 return new ArrayList<UserApplicationRoles>();
426 @RequestMapping(value = { "/portalApi/app/{appId}/roles" }, method = {
427 RequestMethod.GET }, produces = "application/json")
428 public List<EcompRole> testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId)
429 throws HTTPException {
430 EcompRole[] appRoles = applicationsRestClientService.get(EcompRole[].class, appId, "/roles");
431 List<EcompRole> rolesList = Arrays.asList(appRoles);
432 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/app/{appId}/roles", "response for appId=" + appId,
438 @RequestMapping(value = { "/portalApi/admin/import/app/{appId}/roles" }, method = {
439 RequestMethod.GET }, produces = "application/json")
440 public List<EPRole> importRolesFromRemoteApplication(HttpServletRequest request, @PathVariable("appId") Long appId)
441 throws HTTPException {
442 List<EPRole> rolesList = userRolesService.importRolesFromRemoteApplication(appId);
443 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/admin/import/app/{appId}/roles",
444 "response for appId=" + appId, rolesList);
449 @RequestMapping(value = { "/portalApi/app/{appId}/user/{orgUserId}/roles" }, method = {
450 RequestMethod.GET }, produces = "application/json")
451 public EcompRole testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId,
452 @PathVariable("orgUserId") String orgUserId) throws Exception {
453 if (!EcompPortalUtils.legitimateUserId(orgUserId)) {
454 String msg = "Error /user/<user>/roles not legitimate orgUserId = " + orgUserId;
455 logger.error(EELFLoggerDelegate.errorLogger, msg);
456 throw new Exception(msg);
458 EcompRole[] roles = applicationsRestClientService.get(EcompRole[].class, appId,
459 String.format("/user/%s/roles", orgUserId));
460 if (roles.length != 1) {
461 String msg = "Error /user/<user>/roles returned array. expected size 1 recieved size = " + roles.length;
462 logger.error(EELFLoggerDelegate.errorLogger, msg);
463 throw new Exception(msg);
466 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/app/{appId}/user/{orgUserId}/roles",
467 "response for appId='" + appId + "' and orgUserId='" + orgUserId + "'", roles[0]);
471 @RequestMapping(value = { "/portalApi/saveUserAppRoles" }, method = {
472 RequestMethod.PUT }, produces = "application/json")
473 public FieldsValidator putAppWithUserRoleRequest(HttpServletRequest request,
474 @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) {
475 FieldsValidator fieldsValidator = null;
478 EPUser user = EPUserUtils.getUserSession(request);
479 fieldsValidator = userRolesService.putUserAppRolesRequest(newAppRolesForUser, user);
480 response.setStatus(fieldsValidator.httpStatusCode.intValue());
482 } catch (Exception e) {
483 logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleRequest failed", e);
486 // return fieldsValidator;
487 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/saveUserAppRoles", "PUT result =",
488 response.getStatus());
489 return fieldsValidator;
492 @RequestMapping(value = { "/portalApi/appCatalogRoles" }, method = {
493 RequestMethod.GET }, produces = "application/json")
494 public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(HttpServletRequest request,
495 @RequestParam("appName") String appName) {
496 EPUser user = EPUserUtils.getUserSession(request);
497 List<EPUserAppCatalogRoles> userAppRoleList = null;
499 userAppRoleList = userRolesService.getUserAppCatalogRoles(user, appName);
500 } catch (Exception e) {
501 logger.error(EELFLoggerDelegate.errorLogger, "putUserWidgetsSortPref failed", e);
504 Collections.sort(userAppRoleList, getUserAppCatalogRolesComparator);
505 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userApplicationRoles", "result =", userAppRoleList);
507 return userAppRoleList;
511 private Comparator<EPUserAppCatalogRoles> getUserAppCatalogRolesComparator = new Comparator<EPUserAppCatalogRoles>() {
512 public int compare(EPUserAppCatalogRoles o1, EPUserAppCatalogRoles o2) {
513 return o1.getRolename().compareTo(o2.getRolename());
517 @RequestMapping(value = "/portalApi/externalRequestAccessSystem", method = RequestMethod.GET, produces = "application/json")
518 public ExternalSystemAccess readExternalRequestAccess(HttpServletRequest request) {
519 ExternalSystemAccess result = null;
521 result = userRolesService.getExternalRequestAccess();
522 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/externalRequestAccessSystem", "GET result =",
524 } catch (Exception e) {
525 logger.error(EELFLoggerDelegate.errorLogger, "readExternalRequestAccess failed: " + e.getMessage());