Index: branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveAdminClient.cs
===================================================================
--- branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveAdminClient.cs	(revision 15913)
+++ branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveAdminClient.cs	(revision 15922)
@@ -70,25 +70,43 @@
     }
 
-    private Dictionary<Guid, HashSet<Project>> projectAncestors;
-    public Dictionary<Guid, HashSet<Project>> ProjectAncestors {
+    //private Dictionary<Guid, HashSet<Project>> projectAncestors;
+    //public Dictionary<Guid, HashSet<Project>> ProjectAncestors {
+    //  get { return projectAncestors; }
+    //}
+
+    //private Dictionary<Guid, HashSet<Project>> projectDescendants;
+    //public Dictionary<Guid, HashSet<Project>> ProjectDescendants {
+    //  get { return projectDescendants; }
+    //}
+
+    //private Dictionary<Guid, HashSet<Resource>> resourceAncestors;
+    //public Dictionary<Guid, HashSet<Resource>> ResourceAncestors {
+    //  get { return resourceAncestors; }
+    //}
+
+    //private Dictionary<Guid, HashSet<Resource>> resourceDescendants;
+    //public Dictionary<Guid, HashSet<Resource>> ResourceDescendants {
+    //  get { return resourceDescendants; }
+    //}
+
+    private Dictionary<Guid, HashSet<Guid>> projectAncestors;
+    public Dictionary<Guid, HashSet<Guid>> ProjectAncestors {
       get { return projectAncestors; }
     }
 
-    private Dictionary<Guid, HashSet<Project>> projectDescendants;
-    public Dictionary<Guid, HashSet<Project>> ProjectDescendants {
+    private Dictionary<Guid, HashSet<Guid>> projectDescendants;
+    public Dictionary<Guid, HashSet<Guid>> ProjectDescendants {
       get { return projectDescendants; }
     }
 
-    private Dictionary<Guid, HashSet<Resource>> resourceAncestors;
-    public Dictionary<Guid, HashSet<Resource>> ResourceAncestors {
+    private Dictionary<Guid, HashSet<Guid>> resourceAncestors;
+    public Dictionary<Guid, HashSet<Guid>> ResourceAncestors {
       get { return resourceAncestors; }
     }
 
-    private Dictionary<Guid, HashSet<Resource>> resourceDescendants;
-    public Dictionary<Guid, HashSet<Resource>> ResourceDescendants {
+    private Dictionary<Guid, HashSet<Guid>> resourceDescendants;
+    public Dictionary<Guid, HashSet<Guid>> ResourceDescendants {
       get { return resourceDescendants; }
     }
-
-
     #endregion
 
@@ -117,8 +135,12 @@
         projectResourceAssignments = new ItemList<AssignedProjectResource>();
 
-        projectAncestors = new Dictionary<Guid, HashSet<Project>>();
-        projectDescendants = new Dictionary<Guid, HashSet<Project>>();
-        resourceAncestors = new Dictionary<Guid, HashSet<Resource>>();
-        resourceDescendants = new Dictionary<Guid, HashSet<Resource>>();
+        //projectAncestors = new Dictionary<Guid, HashSet<Project>>();
+        //projectDescendants = new Dictionary<Guid, HashSet<Project>>();
+        //resourceAncestors = new Dictionary<Guid, HashSet<Resource>>();
+        //resourceDescendants = new Dictionary<Guid, HashSet<Resource>>();
+        projectAncestors = new Dictionary<Guid, HashSet<Guid>>();
+        projectDescendants = new Dictionary<Guid, HashSet<Guid>>();
+        resourceAncestors = new Dictionary<Guid, HashSet<Guid>>();
+        resourceDescendants = new Dictionary<Guid, HashSet<Guid>>();
 
         HiveServiceLocator.Instance.CallHiveService(service => {
@@ -132,6 +154,6 @@
         });
 
-        UpdateResourceGenealogy(resources);
-        UpdateProjectGenealogy(projects);
+        UpdateResourceGenealogy();
+        UpdateProjectGenealogy();
       }
       catch {
@@ -143,51 +165,92 @@
     }
 
-    public void UpdateResourceGenealogy(IItemList<Resource> resources) {
+    //public void UpdateResourceGenealogy(IItemList<Resource> resources) {
+    //  resourceAncestors.Clear();
+    //  resourceDescendants.Clear();
+
+    //  foreach (var r in resources) {
+    //    resourceAncestors.Add(r.Id, new HashSet<Resource>());
+    //    resourceDescendants.Add(r.Id, new HashSet<Resource>());
+    //  }
+
+    //  foreach (var r in resources) {
+    //    var parentResourceId = r.ParentResourceId;
+    //    while (parentResourceId != null) {
+    //      var parent = resources.SingleOrDefault(x => x.Id == parentResourceId);
+    //      if (parent != null) {
+    //        resourceAncestors[r.Id].Add(parent);
+    //        resourceDescendants[parent.Id].Add(r);
+    //        parentResourceId = parent.ParentResourceId;
+    //      } else {
+    //        parentResourceId = null;
+    //      }
+    //    }
+    //  }
+    //}
+
+    //public void UpdateProjectGenealogy(IItemList<Project> projects) {
+    //  projectAncestors.Clear();
+    //  projectDescendants.Clear();
+
+    //  foreach (var p in projects) {
+    //    projectAncestors.Add(p.Id, new HashSet<Project>());
+    //    projectDescendants.Add(p.Id, new HashSet<Project>());
+    //  }
+
+    //  foreach (var p in projects) {
+    //    var parentProjectId = p.ParentProjectId;
+    //    while (parentProjectId != null) {
+    //      var parent = projects.SingleOrDefault(x => x.Id == parentProjectId);
+    //      if (parent != null) {
+    //        projectAncestors[p.Id].Add(parent);
+    //        projectDescendants[parent.Id].Add(p);
+    //        parentProjectId = parent.ParentProjectId;
+    //      } else {
+    //        parentProjectId = null;
+    //      }
+    //    }
+    //  }
+    //}
+
+    private void UpdateResourceGenealogy() {
       resourceAncestors.Clear();
       resourceDescendants.Clear();
 
-      foreach (var r in resources) {
-        resourceAncestors.Add(r.Id, new HashSet<Resource>());
-        resourceDescendants.Add(r.Id, new HashSet<Resource>());
-      }
-
-      foreach (var r in resources) {
-        var parentResourceId = r.ParentResourceId;
-        while (parentResourceId != null) {
-          var parent = resources.SingleOrDefault(x => x.Id == parentResourceId);
-          if (parent != null) {
-            resourceAncestors[r.Id].Add(parent);
-            resourceDescendants[parent.Id].Add(r);
-            parentResourceId = parent.ParentResourceId;
-          } else {
-            parentResourceId = null;
-          }
-        }
-      }
-    }
-
-    public void UpdateProjectGenealogy(IItemList<Project> projects) {
+      // fetch resource ancestor set
+      HiveServiceLocator.Instance.CallHiveService(service => {
+        var ra = service.GetResourceGenealogy();
+        ra.Keys.ToList().ForEach(k => resourceAncestors.Add(k, new HashSet<Guid>()));
+        resourceAncestors.Keys.ToList().ForEach(k => resourceAncestors[k].UnionWith(ra[k]));
+      });
+
+      // build resource descendant set
+      resourceAncestors.Keys.ToList().ForEach(k => resourceDescendants.Add(k, new HashSet<Guid>()));
+      foreach (var ra in resourceAncestors) {
+        foreach (var ancestor in ra.Value) {
+          resourceDescendants[ancestor].Add(ra.Key);
+        }
+      }
+    }
+
+    private void UpdateProjectGenealogy() {
       projectAncestors.Clear();
       projectDescendants.Clear();
 
-      foreach (var p in projects) {
-        projectAncestors.Add(p.Id, new HashSet<Project>());
-        projectDescendants.Add(p.Id, new HashSet<Project>());
-      }
-
-      foreach (var p in projects) {
-        var parentProjectId = p.ParentProjectId;
-        while (parentProjectId != null) {
-          var parent = projects.SingleOrDefault(x => x.Id == parentProjectId);
-          if (parent != null) {
-            projectAncestors[p.Id].Add(parent);
-            projectDescendants[parent.Id].Add(p);
-            parentProjectId = parent.ParentProjectId;
-          } else {
-            parentProjectId = null;
-          }
-        }
-      }
-    }
+      // fetch project ancestor list
+      HiveServiceLocator.Instance.CallHiveService(service => {
+        var pa = service.GetProjectGenealogy();
+        pa.Keys.ToList().ForEach(k => projectAncestors.Add(k, new HashSet<Guid>()));
+        projectAncestors.Keys.ToList().ForEach(k => projectAncestors[k].UnionWith(pa[k]));
+      });
+
+      // build project descendant list
+      projectAncestors.Keys.ToList().ForEach(k => projectDescendants.Add(k, new HashSet<Guid>()));
+      foreach (var pa in projectAncestors) {
+        foreach (var ancestor in pa.Value) {
+          projectDescendants[ancestor].Add(pa.Key);
+        }
+      }
+    }
+
     #endregion
 
@@ -268,4 +331,24 @@
 
     #region Helper
+    public IEnumerable<Project> GetAvailableProjectAncestors(Guid id) {
+      if (projectAncestors.ContainsKey(id)) return projects.Where(x => projectAncestors[id].Contains(x.Id));
+      else return Enumerable.Empty<Project>();
+    }
+
+    public IEnumerable<Project> GetAvailableProjectDescendants(Guid id) {
+      if(projectDescendants.ContainsKey(id)) return projects.Where(x => projectDescendants[id].Contains(x.Id));
+      else return Enumerable.Empty<Project>();
+    }
+
+    public IEnumerable<Resource> GetAvailableResourceAncestors(Guid id) {
+      if (resourceAncestors.ContainsKey(id)) return resources.Where(x => resourceAncestors[id].Contains(x.Id));
+      else return Enumerable.Empty<Resource>();
+    }
+
+    public IEnumerable<Resource> GetAvailableResourceDescendants(Guid id) {
+      if (resourceDescendants.ContainsKey(id)) return resources.Where(x => resourceDescendants[id].Contains(x.Id));
+      else return Enumerable.Empty<Resource>();
+    }
+
     public bool CheckAccessToAdminAreaGranted() {
       if(projects != null) {
@@ -286,5 +369,5 @@
         return true;
       } else if(resourceAncestors.ContainsKey(res.Id)) {
-        return resourceAncestors[res.Id].Where(x => x.OwnerUserId == userId).Any();
+        return GetAvailableResourceAncestors(res.Id).Where(x => x.OwnerUserId == userId).Any();
       }
 
@@ -298,5 +381,5 @@
         return true;
       } else if (projectAncestors.ContainsKey(pro.Id)) {
-        return projectAncestors[pro.Id].Where(x => x.OwnerUserId == userId).Any();
+        return GetAvailableProjectAncestors(pro.Id).Where(x => x.OwnerUserId == userId).Any();
       }
 
@@ -308,5 +391,5 @@
 
       if(projectAncestors.ContainsKey(pro.Id)) {
-        return projectAncestors[pro.Id].Where(x => x.OwnerUserId == userId).Any();
+        return GetAvailableProjectAncestors(pro.Id).Where(x => x.OwnerUserId == userId).Any();
       }
 
@@ -327,5 +410,5 @@
       } else if(parent != null && projectDescendants.ContainsKey(child.Id)) {
         // ... if the new parent is among the moved project's descendants
-        changePossible = !projectDescendants[child.Id].Where(x => x.Id == parent.Id).Any();
+        changePossible = !GetAvailableProjectDescendants(child.Id).Where(x => x.Id == parent.Id).Any();
       }
 
@@ -350,5 +433,5 @@
       } else if (parent != null && resourceDescendants.ContainsKey(child.Id)) {
         // ... or if the new parent is among the moved resource's descendants
-        changePossible = !resourceDescendants[child.Id].Where(x => x.Id == parent.Id).Any();
+        changePossible = !GetAvailableResourceDescendants(child.Id).Where(x => x.Id == parent.Id).Any();
       }
 
Index: branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
===================================================================
--- branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveClient.cs	(revision 15913)
+++ branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveClient.cs	(revision 15922)
@@ -239,20 +239,23 @@
     }
 
-    public IEnumerable<Project> GetAvailableParentProjects(Guid id) {
-      return projects.Where(x => projectAncestors[id].Contains(x.Id));
-    }
-
-    public IEnumerable<Project> GetAvailableChildProjects(Guid id) {
-      return projects.Where(x => projectDescendants[id].Contains(x.Id));
-    }
-
-    public IEnumerable<Resource> GetAvailableParentResources(Guid id) {
-      return resources.Where(x => resourceAncestors[id].Contains(x.Id));
-    }
-
-    public IEnumerable<Resource> GetAvailableChildResources(Guid id) {
-      return resources.Where(x => resourceDescendants[id].Contains(x.Id));
-    }
-
+    public IEnumerable<Project> GetAvailableProjectAncestors(Guid id) {
+      if (projectAncestors.ContainsKey(id)) return projects.Where(x => projectAncestors[id].Contains(x.Id));
+      else return Enumerable.Empty<Project>();
+    }
+
+    public IEnumerable<Project> GetAvailableProjectDescendants(Guid id) {
+      if (projectDescendants.ContainsKey(id)) return projects.Where(x => projectDescendants[id].Contains(x.Id));
+      else return Enumerable.Empty<Project>();
+    }
+
+    public IEnumerable<Resource> GetAvailableResourceAncestors(Guid id) {
+      if (resourceAncestors.ContainsKey(id)) return resources.Where(x => resourceAncestors[id].Contains(x.Id));
+      else return Enumerable.Empty<Resource>();
+    }
+
+    public IEnumerable<Resource> GetAvailableResourceDescendants(Guid id) {
+      if (resourceDescendants.ContainsKey(id)) return resources.Where(x => resourceDescendants[id].Contains(x.Id));
+      else return Enumerable.Empty<Resource>();
+    }
     #endregion
 
