Index: branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs
===================================================================
--- branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs	(revision 15496)
+++ branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs	(revision 15497)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using System.Data.Linq;
 using System.Linq;
@@ -40,4 +41,12 @@
     }
 
+    public IEnumerable<Guid> GetResourceIdsByParentId(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetResourceIdsByParentIdQuery, id);
+    }
+
+    public IEnumerable<Resource> GetResourcesByParentId(Guid id) {
+      return DataContext.ExecuteQuery<Resource>(GetResourcesByParentIdQuery, id);
+    }
+
     #region Compiled queries
     private static readonly Func<DataContext, Guid, Resource> GetByIdQuery =
@@ -53,4 +62,36 @@
         select resource).FirstOrDefault());
     #endregion
+
+    #region String queries
+    private const string GetResourcesByParentIdQuery = @"
+      WITH rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rt.ParentResourceId <> rt.ResourceId
+      )
+      SELECT DISTINCT rtree.ResourceId
+      FROM rtree
+      WHERE rtree.ParentResourceId = ({0})
+    ";
+    private const string GetResourceIdsByParentIdQuery = @"
+    	WITH rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rt.ParentResourceId <> rt.ResourceId
+      )
+      SELECT DISTINCT res.*
+      FROM rtree, [Resource] res
+      WHERE rtree.ParentResourceId = ({0})
+	    AND rtree.ResourceId = res.ResourceId
+    ";
+    #endregion
   }
 }
Index: branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourcePermissionDao.cs
===================================================================
--- branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourcePermissionDao.cs	(revision 15496)
+++ branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourcePermissionDao.cs	(revision 15497)
@@ -56,16 +56,16 @@
       (
 	      SELECT ResourceId, ParentResourceId
-	      FROM [dbo].Resource
+	      FROM [Resource]
 	      UNION ALL
 	      SELECT rt.ResourceId, r.ParentResourceId
-	      FROM [dbo].Resource r
+	      FROM [Resource] r
 	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rt.ParentResourceId <> rt.ResourceId
       )
-      SELECT DISTINCT rtree.ResourceId FROM rtree, ResourcePermission rp
-      WHERE rtree.ParentResourceId = rp.ResourceId
-      AND rp.GrantedUserId IN ({0})
+      SELECT DISTINCT rtree.ResourceId
+      FROM rtree, [ResourcePermission] rp
+      WHERE rtree.ParentResourceId = rp.ResourceId AND rp.GrantedUserId IN ({0})
       UNION ALL
       SELECT rp.ResourceId
-      FROM ResourcePermission rp
+      FROM [ResourcePermission] rp
       WHERE rp.GrantedUserId IN ({0})
       ;";
Index: branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs
===================================================================
--- branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs	(revision 15496)
+++ branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs	(revision 15497)
@@ -106,5 +106,5 @@
       )
       SELECT DISTINCT t.TaskId, t.JobId, t.Priority
-      FROM pr JOIN AssignedTaskResources ar ON ar.ResourceId = pr.ResourceId
+      FROM pr JOIN AssignedTaskResource ar ON ar.ResourceId = pr.ResourceId
           JOIN Task t ON t.TaskId = ar.TaskId
       WHERE NOT (t.IsParentTask = 1 AND t.FinishWhenChildJobsFinished = 1)
Index: branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IPersistenceManager.cs
===================================================================
--- branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IPersistenceManager.cs	(revision 15496)
+++ branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IPersistenceManager.cs	(revision 15497)
@@ -43,4 +43,5 @@
     RequiredPluginDao RequiredPluginDao { get; }
     ResourceDao ResourceDao { get; }
+    ResourcePermissionDao ResourcePermissionDao { get; }
     SlaveDao SlaveDao { get; }
     SlaveGroupDao SlaveGroupDao { get; }
Index: branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs
===================================================================
--- branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs	(revision 15496)
+++ branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs	(revision 15497)
@@ -83,7 +83,7 @@
     }
 
-    private ProjectPermissionDao resourcePermissionDao;
+    private ProjectPermissionDao projectPermissionDao;
     public ProjectPermissionDao ProjectPermissionDao {
-      get { return resourcePermissionDao ?? (resourcePermissionDao = new ProjectPermissionDao(dataContext)); }
+      get { return projectPermissionDao ?? (projectPermissionDao = new ProjectPermissionDao(dataContext)); }
     }
 
@@ -96,4 +96,9 @@
     public ResourceDao ResourceDao {
       get { return resourceDao ?? (resourceDao = new ResourceDao(dataContext)); }
+    }
+
+    private ResourcePermissionDao resourcePermissionDao;
+    public ResourcePermissionDao ResourcePermissionDao {
+      get { return resourcePermissionDao ?? (resourcePermissionDao = new ResourcePermissionDao(dataContext)); }
     }
 
