          }
          return perms;
      }
-@@ -821,8 +863,20 @@
+@@ -821,8 +871,20 @@
          for (String nodeId : nodeIds) {
              m.put(nodeId, new HashMap<String, Set<String>>());
          }

             }
         }
     }
@@ -782,14 +806,23 @@
         }
         Set<String> userIds = new HashSet<String>();
         if (nodeIds.length > 0) {

+                List<HierarchyNodePermission> nodePerms = new ArrayList<HierarchyNodePermission>();
+                do{ 
+                	int arraySize = nodeIdsList.size() - i;
+                	if(oracle && arraySize > ORACLE_IN_CLAUSE_SIZE_LIMIT){
+                		arraySize = ORACLE_IN_CLAUSE_SIZE_LIMIT;
+                	}
+                	// get all the permissions which are related to the nodes under this one
