get service models from SDC - Fix 91/17191/2
authorOfir Sonsino <os0695@att.com>
Wed, 4 Oct 2017 09:32:47 +0000 (12:32 +0300)
committerOfir Sonsino <os0695@att.com>
Wed, 4 Oct 2017 09:47:11 +0000 (12:47 +0300)
Change-Id: I936482305790ca9b01ad5d9c8c804cb8df814f91
Issue-ID: VID-74
Signed-off-by: Ofir Sonsino <os0695@att.com>
vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java
vid-app-common/src/main/java/org/openecomp/vid/roles/RoleProvider.java
vid-app-common/src/main/java/org/openecomp/vid/roles/RoleValidator.java
vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js

index aac3a0b..f21036e 100755 (executable)
@@ -73,7 +73,8 @@ public class VidController extends RestrictedBaseController {
                        Map<String, String[]> requestParams = request.getParameterMap();\r
                        List<Role> roles = new RoleProvider().getUserRoles(request);\r
                        secureServices.setServices(service.getServices(requestParams));\r
-                       secureServices.setReadOnly(roleProvider.userPermissionIsReadOnly(roles));\r
+                       //Disable roles until AAF integration finishes\r
+                       //secureServices.setReadOnly(roleProvider.userPermissionIsReadOnly(roles));\r
                        return secureServices;\r
                } catch (AsdcCatalogException e) {\r
                        LOG.error("Failed to retrieve service definitions from SDC", e);\r
index 99645a1..2ed5bdb 100644 (file)
@@ -15,6 +15,7 @@ public class RoleProvider {
 
     private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(RoleProvider.class);
     final String readPermissionString = "read";
+    final String roleStringDelimiter = "_";
 
     public static List<String> extractRoleFromSession(HttpServletRequest request) {
 
@@ -24,7 +25,8 @@ public class RoleProvider {
 
     public List<Role> getUserRoles(HttpServletRequest request) {
         List<Role> roleList = new ArrayList<>();
-        HashMap roles = UserUtils.getRoles(request);
+               //Disable roles until AAF integration finishes
+        /*HashMap roles = UserUtils.getRoles(request);
         for (Object role : roles.keySet()) {
             org.openecomp.portalsdk.core.domain.Role sdkRol = (org.openecomp.portalsdk.core.domain.Role) roles.get(role);
             try {
@@ -36,13 +38,13 @@ public class RoleProvider {
                 LOG.error("Failed to parse permission", e);
 
             }
-        }
+        }*/
 
         return roleList;
     }
 
     public String[] splitRole(String roleAsString) {
-        return roleAsString.split("_");
+        return roleAsString.split(roleStringDelimiter);
     }
 
     public boolean userPermissionIsReadOnly(List<Role> roles) {
index a7085e5..9031524 100644 (file)
@@ -10,6 +10,7 @@ import java.util.Map;
  */
 public class RoleValidator {
 
+       //Disable roles until AAF integration finishes
        private boolean disableRoles = true;
     private List<Role> userRoles;
 
index a003088..8844d40 100755 (executable)
@@ -39,8 +39,8 @@
                        $http.get(pathQuery)\r
                        .then(function successCallback(response) {\r
                                $scope.services = [];\r
-                               if (angular.isArray(response.data)) {\r
-                                       wholeData = response.data;\r
+                               if (response.data && angular.isArray(response.data.services)) {\r
+                                       wholeData = response.data.services;\r
                                        $scope.services = $scope.filterDataWithHigerVersion(wholeData);\r
                                        $scope.viewPerPage=10;\r
                                        $scope.totalPage=$scope.services.length/$scope.viewPerPage;\r