summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-BE-common/src')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java3
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java22
2 files changed, 14 insertions, 11 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java
index 9feecec1..0be0d357 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java
@@ -789,7 +789,8 @@ public class AppsController extends EPRestrictedBaseController {
EcompPortalUtils.setBadPermissions(user, response, "postOnboardingApps");
} else {
newOnboardingApp.normalize();
- checkIfNameSpaceIsValid(newOnboardingApp, fieldsValidator, response);
+ if(newOnboardingApp.isCentralAuth != null && newOnboardingApp.isCentralAuth)
+ checkIfNameSpaceIsValid(newOnboardingApp, fieldsValidator, response);
fieldsValidator = appService.addOnboardingApp(newOnboardingApp, user);
response.setStatus(fieldsValidator.httpStatusCode.intValue());
}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java
index 45035a25..b718d56a 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java
@@ -121,17 +121,18 @@ public class WidgetsController extends EPRestrictedBaseController {
@RequestBody OnboardingWidget onboardingWidget, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
FieldsValidator fieldsValidator = null;
- if (onboardingWidget!=null){
- if(!dataValidator.isValid(onboardingWidget)){
+ if (onboardingWidget!=null && !dataValidator.isValid(onboardingWidget)){
fieldsValidator = new FieldsValidator();
fieldsValidator.setHttpStatusCode((long)HttpServletResponse.SC_NOT_ACCEPTABLE);
return fieldsValidator;
- }
}
if (userHasPermissions(user, response, "putOnboardingWidget")) {
- onboardingWidget.id = widgetId; // !
- onboardingWidget.normalize();
+ if (onboardingWidget != null) {
+ onboardingWidget.id = widgetId; // !
+ onboardingWidget.normalize();
+ }
+
fieldsValidator = widgetService.setOnboardingWidget(user, onboardingWidget);
response.setStatus(fieldsValidator.httpStatusCode.intValue());
}
@@ -146,17 +147,18 @@ public class WidgetsController extends EPRestrictedBaseController {
EPUser user = EPUserUtils.getUserSession(request);
FieldsValidator fieldsValidator = null;
- if (onboardingWidget!=null){
- if(!dataValidator.isValid(onboardingWidget)){
+ if (onboardingWidget!=null && !dataValidator.isValid(onboardingWidget)){
fieldsValidator = new FieldsValidator();
fieldsValidator.setHttpStatusCode((long)HttpServletResponse.SC_NOT_ACCEPTABLE);
return fieldsValidator;
- }
}
if (userHasPermissions(user, response, "postOnboardingWidget")) {
- onboardingWidget.id = null; // !
- onboardingWidget.normalize();
+
+ if (onboardingWidget != null) {
+ onboardingWidget.id = null; // !
+ onboardingWidget.normalize();
+ }
fieldsValidator = widgetService.setOnboardingWidget(user, onboardingWidget);
response.setStatus(fieldsValidator.httpStatusCode.intValue());
}