          }
          return l;
      }
-@@ -966,8 +1043,19 @@
+@@ -966,8 +1051,19 @@
              for (int i = 0; i < nodeIds.length; i++) {
                  pNodeIds[i] = new Long(nodeIds[i]);
              }

             }
         }
     }
@@ -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
