Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs	(revision 15526)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs	(revision 15527)
@@ -33,10 +33,26 @@
     }
 
-    public IEnumerable<Project> GetProjectsByChildId(Guid id) {
-      return DataContext.ExecuteQuery<Project>(GetProjectsByChildIdQuery, id);
+    public IEnumerable<Project> GetChildProjectsById(Guid id) {
+      return DataContext.ExecuteQuery<Project>(GetChildProjectsByIdQuery, id);
     }
 
-    public IEnumerable<Guid> GetProjectIdsByChildId(Guid id) {
-      return DataContext.ExecuteQuery<Guid>(GetProjectIdsByChildIdQuery, id);
+    public IEnumerable<Guid> GetChildProjectIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetChildProjectIdsByIdQuery, id);
+    }
+
+    public IEnumerable<Project> GetParentProjectsById(Guid id) {
+      return DataContext.ExecuteQuery<Project>(GetParentProjectsByIdQuery, id);
+    }
+
+    public IEnumerable<Guid> GetParentProjectIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetParentProjectIdsByIdQuery, id);
+    }
+
+    public IEnumerable<Project> GetCurrentAndParentProjectsById(Guid id) {
+      return DataContext.ExecuteQuery<Project>(GetCurrentAndParentProjectsByIdQuery, id);
+    }
+
+    public IEnumerable<Guid> GetCurrentAndParentProjectIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetCurrentAndParentProjectIdsByIdQuery, id);
     }
 
@@ -50,9 +66,9 @@
 
     #region String queries
-    private const string GetProjectsByChildIdQuery = @"
-      WITH ptree AS
+    private const string GetChildProjectsByIdQuery = @"
+    	WITH ptree AS
       (
 	      SELECT ProjectId, ParentProjectId
-        FROM [Project]
+	      FROM [Project]
 	      UNION ALL
 	      SELECT pt.ProjectId, p.ParentProjectId
@@ -62,20 +78,78 @@
       SELECT DISTINCT pro.*
       FROM ptree, [Project] pro
-      WHERE ptree.ProjectId = {0}
-      AND ptree.ParentProjectId = pro.ProjectId
+      WHERE ptree.ParentProjectId = {0}
+	    AND ptree.ProjectId = pro.ProjectId
     ";
-    private const string GetProjectIdsByChildIdQuery = @"
+    private const string GetChildProjectIdsByIdQuery = @"
       WITH ptree AS
+      (
+	      SELECT ProjectId, ParentProjectId
+	      FROM [Project]
+	      UNION ALL
+	      SELECT pt.ProjectId, r.ParentProjectId
+	      FROM [Project] r
+	      JOIN ptree pt ON pt.ParentProjectId = r.ProjectId AND r.ParentProjectId <> r.ProjectId AND pt.ParentProjectId <> pt.ProjectId
+      )
+      SELECT DISTINCT ptree.ProjectId
+      FROM ptree
+      WHERE ptree.ParentProjectId = {0}
+    ";
+    private const string GetParentProjectsByIdQuery = @"
+      WITH pbranch AS
       (
 	      SELECT ProjectId, ParentProjectId
         FROM [Project]
 	      UNION ALL
-	      SELECT pt.ProjectId, p.ParentProjectId
+	      SELECT pb.ProjectId, p.ParentProjectId
 	      FROM [Project] p
-	      JOIN ptree pt ON pt.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pt.ParentProjectId <> pt.ProjectId
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pb.ParentProjectId <> pb.ProjectId
       )
-      SELECT DISTINCT ptree.ParentProjectId
-      FROM ptree
-      WHERE ptree.ProjectId = {0}
+      SELECT DISTINCT pro.*
+      FROM pbranch, [Project] pro
+      WHERE pbranch.ProjectId = {0}
+      AND pbranch.ParentProjectId = pro.ProjectId
+    ";
+    private const string GetParentProjectIdsByIdQuery = @"
+      WITH pbranch AS
+      (
+	      SELECT ProjectId, ParentProjectId
+        FROM [Project]
+	      UNION ALL
+	      SELECT pb.ProjectId, p.ParentProjectId
+	      FROM [Project] p
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pb.ParentProjectId <> pb.ProjectId
+      )
+      SELECT DISTINCT pbranch.ParentProjectId
+      FROM pbranch
+      WHERE pbranch.ProjectId = {0}
+    ";
+    private const string GetCurrentAndParentProjectsByIdQuery = @"
+      WITH pbranch AS
+      (
+	      SELECT ProjectId, ParentProjectId
+	      FROM Project
+	      WHERE ProjectId = {0}
+	      UNION ALL
+	      SELECT p.ProjectId, p.ParentProjectId
+	      FROM Project p
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId
+      )
+      SELECT DISTINCT pro.*
+      FROM pbranch, Project pro
+      WHERE pbranch.ProjectId = pro.ProjectId
+    ";
+    private const string GetCurrentAndParentProjectIdsByIdQuery = @"
+      WITH pbranch AS
+      (
+	      SELECT ProjectId, ParentProjectId
+	      FROM Project
+	      WHERE ProjectId = {0}
+	      UNION ALL
+	      SELECT p.ProjectId, p.ParentProjectId
+	      FROM Project p
+	      JOIN pbranch pb ON pb.ParentProjectId = p.ProjectId
+      )
+      SELECT DISTINCT pbranch.ProjectId
+      FROM pbranch
     ";
     #endregion
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs	(revision 15526)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs	(revision 15527)
@@ -41,18 +41,26 @@
     }
 
-    public IEnumerable<Resource> GetResourcesByParentId(Guid id) {
-      return DataContext.ExecuteQuery<Resource>(GetResourcesByParentIdQuery, id);
+    public IEnumerable<Resource> GetChildResourcesById(Guid id) {
+      return DataContext.ExecuteQuery<Resource>(GetChildResourcesByIdQuery, id);
     }
 
-    public IEnumerable<Guid> GetResourceIdsByParentId(Guid id) {
-      return DataContext.ExecuteQuery<Guid>(GetResourceIdsByParentIdQuery, id);
+    public IEnumerable<Guid> GetChildResourceIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetChildResourceIdsByIdQuery, id);
     }
 
-    public IEnumerable<Resource> GetResourcesByChildId(Guid id) {
-      return DataContext.ExecuteQuery<Resource>(GetResourcesByChildIdQuery, id);
+    public IEnumerable<Resource> GetParentResourcesById(Guid id) {
+      return DataContext.ExecuteQuery<Resource>(GetParentResourcesByIdQuery, id);
     }
 
-    public IEnumerable<Guid> GetResourceIdsByChildId(Guid id) {
-      return DataContext.ExecuteQuery<Guid>(GetResourceIdsByChildIdQuery, id);
+    public IEnumerable<Guid> GetParentResourceIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetParentResourceIdsByIdQuery, id);
+    }
+
+    public IEnumerable<Resource> GetCurrentAndParentResourcesById(Guid id) {
+      return DataContext.ExecuteQuery<Resource>(GetCurrentAndParentResourcesByIdQuery, id);
+    }
+
+    public IEnumerable<Guid> GetCurrentAndParentResourceIdsById(Guid id) {
+      return DataContext.ExecuteQuery<Guid>(GetCurrentAndParentResourceIdsByIdQuery, id);
     }
 
@@ -72,5 +80,5 @@
 
     #region String queries
-    private const string GetResourcesByParentIdQuery = @"
+    private const string GetChildResourcesByIdQuery = @"
     	WITH rtree AS
       (
@@ -84,8 +92,8 @@
       SELECT DISTINCT res.*
       FROM rtree, [Resource] res
-      WHERE rtree.ParentResourceId = ({0})
+      WHERE rtree.ParentResourceId = {0}
 	    AND rtree.ResourceId = res.ResourceId
     ";
-    private const string GetResourceIdsByParentIdQuery = @"
+    private const string GetChildResourceIdsByIdQuery = @"
       WITH rtree AS
       (
@@ -99,34 +107,63 @@
       SELECT DISTINCT rtree.ResourceId
       FROM rtree
-      WHERE rtree.ParentResourceId = ({0})
+      WHERE rtree.ParentResourceId = {0}
     ";
-    private const string GetResourcesByChildIdQuery = @"
-      WITH rtree AS
+    private const string GetParentResourcesByIdQuery = @"
+      WITH rbranch AS
       (
 	      SELECT ResourceId, ParentResourceId
 	      FROM [Resource]
 	      UNION ALL
-	      SELECT rt.ResourceId, r.ParentResourceId
+	      SELECT rb.ResourceId, r.ParentResourceId
 	      FROM [Resource] r
-	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rt.ParentResourceId <> rt.ResourceId
+	      JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rb.ParentResourceId <> rb.ResourceId
       )
       SELECT DISTINCT res.*
-      FROM rtree, [Resource] res
-      WHERE rtree.ResourceId = ({0})
-      AND rtree.ParentResourceId = res.ResourceId
+      FROM rbranch, [Resource] res
+      WHERE rbranch.ResourceId = {0}
+      AND rbranch.ParentResourceId = res.ResourceId
     ";
-    private const string GetResourceIdsByChildIdQuery = @"
-      WITH rtree AS
+    private const string GetParentResourceIdsByIdQuery = @"
+      WITH rbranch AS
       (
 	      SELECT ResourceId, ParentResourceId
 	      FROM [Resource]
 	      UNION ALL
-	      SELECT rt.ResourceId, r.ParentResourceId
+	      SELECT rb.ResourceId, r.ParentResourceId
 	      FROM [Resource] r
-	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rt.ParentResourceId <> rt.ResourceId
+	      JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId AND r.ParentResourceId <> r.ResourceId AND rb.ParentResourceId <> rb.ResourceId
       )
-      SELECT DISTINCT rtree.ParentResourceId
-      FROM rtree
-      WHERE rtree.ResourceId = ({0})
+      SELECT DISTINCT rbranch.ParentResourceId
+      FROM rbranch
+      WHERE rbranch.ResourceId = {0}
+    ";
+    private const string GetCurrentAndParentResourcesByIdQuery = @"
+      WITH rbranch AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      WHERE ResourceId = {0}
+	      UNION ALL
+	      SELECT r.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
+      )
+      SELECT DISTINCT res.*
+      FROM rbranch, [Resource] res
+      WHERE rbranch.ResourceId = res.ResourceId
+    ";
+    private const string GetCurrentAndParentResourceIdsByIdQuery = @"
+      WITH rbranch AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      WHERE ResourceId = {0}
+	      UNION ALL
+	      SELECT r.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rbranch rb ON rb.ParentResourceId = r.ResourceId
+      )
+      SELECT DISTINCT rbranch.ResourceId
+      FROM rbranch
     ";
     #endregion
Index: anches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourcePermissionDao.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourcePermissionDao.cs	(revision 15526)
+++ 	(revision )
@@ -1,88 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Data.Linq;
-using System.Linq;
-
-namespace HeuristicLab.Services.Hive.DataAccess.Daos {
-  public class ResourcePermissionDao : GenericDao<Guid, ResourcePermission> {
-
-    public ResourcePermissionDao(DataContext dataContext) : base(dataContext) { }
-
-    public override ResourcePermission GetById(Guid id) {
-      throw new NotImplementedException();
-    }
-
-    public IEnumerable<Guid> GetByUserAndGroupIds(IEnumerable<Guid> userAndGroupIds) {
-      string paramIds = string.Join(",", userAndGroupIds.Select(x => string.Format("'{0}'", x)));
-      if (!string.IsNullOrWhiteSpace(paramIds)) {
-        string query = string.Format(GetGrantedResourcesQuery, paramIds);
-        return DataContext.ExecuteQuery<Guid>(query);
-      }
-      return Enumerable.Empty<Guid>();
-    }
-
-    public void DeleteByResourceIdAndGrantedUserId(Guid resourceId, IEnumerable<Guid> grantedUserId) {
-      string paramIds = string.Join(",", grantedUserId.Select(x => string.Format("'{0}'", x)));
-      if (!string.IsNullOrWhiteSpace(paramIds)) {
-        string query = string.Format(DeleteByGrantedUserQuery, resourceId, paramIds);
-        DataContext.ExecuteCommand(query);
-      }
-    }
-
-    #region Compiled queries
-    private static readonly Func<DataContext, Guid, IEnumerable<ResourcePermission>> GetByResourceIdQuery =
-      CompiledQuery.Compile((DataContext db, Guid resourceId) =>
-      from resourcePermission in db.GetTable<ResourcePermission>()
-      where resourcePermission.ResourceId == resourceId
-      select resourcePermission);
-    #endregion
-
-    #region String queries
-    private const string GetGrantedResourcesQuery = @"
-      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, [ResourcePermission] rp
-      WHERE rtree.ParentResourceId = rp.ResourceId AND rp.GrantedUserId IN ({0})
-      UNION ALL
-      SELECT rp.ResourceId
-      FROM [ResourcePermission] rp
-      WHERE rp.GrantedUserId IN ({0})
-      ;";
-
-    private const string DeleteByGrantedUserQuery = @"
-      DELETE FROM [ResourcePermission]
-        WHERE ResourceId = '{0}'
-        AND GrantedUserId IN ({1})
-    ;";
-    #endregion
-  }
-}
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 15526)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml	(revision 15527)
@@ -4,6 +4,6 @@
       <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
       <Column Name="ProjectId" Storage="_JobId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Association Name="Resource_AssignedResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
-      <Association Name="Project_AssignedResource" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="CASCADE" />
+      <Association Name="Resource_AssignedProjectResource" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" DeleteRule="CASCADE" />
+      <Association Name="Project_AssignedProjectResource" Member="Project" ThisKey="ProjectId" OtherKey="ProjectId" Type="Project" IsForeignKey="true" DeleteRule="CASCADE" />
     </Type>
   </Table>
@@ -37,9 +37,8 @@
       <Column Name="HbInterval" Type="System.Int32" DbType="Int" CanBeNull="false" />
       <Column Name="OwnerUserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="true" />
-      <Association Name="Resource_AssignedResource" Member="AssignedProjectResources" Storage="_AssignedResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedProjectResource" />
+      <Association Name="Resource_AssignedProjectResource" Member="AssignedProjectResources" Storage="_AssignedResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedProjectResource" />
       <Association Name="Resource_Resource" Member="ChildResources" ThisKey="ResourceId" OtherKey="ParentResourceId" Type="Resource" />
       <Association Name="Resource_Downtime" Member="Downtimes" Storage="_UptimeCalendars" ThisKey="ResourceId" OtherKey="ResourceId" Type="Downtime" />
       <Association Name="Resource_StateLog" Member="StateLogs" ThisKey="ResourceId" OtherKey="SlaveId" Type="StateLog" />
-      <Association Name="Resource_ResourcePermission" Member="ResourcePermissions" ThisKey="ResourceId" OtherKey="ResourceId" Type="ResourcePermission" />
       <Association Name="Resource_AssignedTaskResource" Member="AssignedTaskResources" ThisKey="ResourceId" OtherKey="ResourceId" Type="AssignedTaskResource" />
       <Association Name="Resource_Resource" Member="ParentResource" ThisKey="ParentResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
@@ -103,5 +102,4 @@
       <Column Name="Name" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
       <Column Name="Description" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
-      <Column Name="ResourceIds" Type="System.String" DbType="VarChar(MAX)" CanBeNull="true" />
       <Column Name="OwnerUserId" Storage="_UserId" Type="System.Guid" DbType="UniqueIdentifier" CanBeNull="false" />
       <Column Name="DateCreated" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
@@ -155,12 +153,4 @@
       <Column Name="LifecycleId" Type="System.Int32" DbType="Int" IsPrimaryKey="true" CanBeNull="false" />
       <Column Name="LastCleanup" Type="System.DateTime" DbType="DateTime" CanBeNull="false" />
-    </Type>
-  </Table>
-  <Table Name="dbo.ResourcePermission" Member="ResourcePermissions">
-    <Type Name="ResourcePermission">
-      <Column Name="ResourceId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="GrantedUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
-      <Column Name="GrantedByUserId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" />
-      <Association Name="Resource_ResourcePermission" Member="Resource" ThisKey="ResourceId" OtherKey="ResourceId" Type="Resource" IsForeignKey="true" />
     </Type>
   </Table>
@@ -268,5 +258,5 @@
       <Column Name="StartDate" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
       <Column Name="EndDate" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
-      <Association Name="Project_AssignedResource" Member="AssignedProjectResources" Storage="_AssignedResources" ThisKey="ProjectId" OtherKey="ProjectId" Type="AssignedProjectResource" />
+      <Association Name="Project_AssignedProjectResource" Member="AssignedProjectResources" Storage="_AssignedResources" ThisKey="ProjectId" OtherKey="ProjectId" Type="AssignedProjectResource" />
       <Association Name="Project_Job" Member="Jobs" ThisKey="ProjectId" OtherKey="ProjectId" Type="Job" />
       <Association Name="Project_Project" Member="ChildProjects" Storage="_Projects" ThisKey="ProjectId" OtherKey="ParentProjectId" Type="Project" />
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 15526)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 15527)
@@ -39,8 +39,8 @@
       </nestedChildShapes>
     </classShape>
-    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 2.1554996744791666">
+    <classShape Id="e6f840cc-2968-4be1-b234-eef624ccacbb" absoluteBounds="4.125, 2.625, 2, 1.9631982421874996">
       <DataClassMoniker Name="/HiveDataContext/Job" />
       <nestedChildShapes>
-        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="0c65d4e1-256a-4a91-9a57-392f25e4de7f" absoluteBounds="4.1400000000000006, 3.0850000000000009, 1.9700000000000002, 1.4031982421875" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
@@ -69,11 +69,4 @@
       </nodes>
     </inheritanceConnector>
-    <associationConnector edgePoints="[(13.25 : 2.15469482421875); (15.71875 : 2.15469482421875); (15.71875 : 8.25)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedResource" />
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
-      </nodes>
-    </associationConnector>
     <classShape Id="6bc13f26-f9a8-4597-b054-35be34190d12" absoluteBounds="4.125, 1, 2, 1.3862939453125">
       <DataClassMoniker Name="/HiveDataContext/TaskData" />
@@ -95,5 +88,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(8.875 : 6.56814697265625); (8.5 : 6.56814697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(8.875 : 6.56814697265625); (8.5 : 6.56814697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" />
       <nodes>
@@ -162,5 +155,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(6.5 : 2.50564697265625); (3.75 : 2.50564697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(6.5 : 2.50564697265625); (3.75 : 2.50564697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Task/Task_StateLog" />
       <nodes>
@@ -169,5 +162,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(6.125 : 3.37100341796875); (6.5 : 3.37100341796875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(6.125 : 3.37100341796875); (6.5 : 3.37100341796875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_Task" />
       <nodes>
@@ -176,5 +169,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(4.125 : 4.20274983723958); (3.75 : 4.20274983723958)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(4.125 : 4.10659912109375); (3.75 : 4.10659912109375)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_JobPermission" />
       <nodes>
@@ -183,17 +176,4 @@
       </nodes>
     </associationConnector>
-    <classShape Id="a3f352be-9f15-4e73-8d44-3e8ac02fb4cf" absoluteBounds="11.25, 3.875, 2, 1.3862939453124996">
-      <DataClassMoniker Name="/HiveDataContext/ResourcePermission" />
-      <nestedChildShapes>
-        <elementListCompartment Id="45e2f1a8-8a1e-4647-b649-10ec55976ab4" absoluteBounds="11.265, 4.335, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
-      </nestedChildShapes>
-    </classShape>
-    <associationConnector edgePoints="[(12.5942481820367 : 2.9631982421875); (12.5942481820367 : 3.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_ResourcePermission" />
-      <nodes>
-        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
-        <classShapeMoniker Id="a3f352be-9f15-4e73-8d44-3e8ac02fb4cf" />
-      </nodes>
-    </associationConnector>
     <classShape Id="f9e8867f-fd15-4a72-8ca4-4f02cd3f141f" absoluteBounds="4.125, 5.5, 2, 1.1939925130208327">
       <DataClassMoniker Name="/HiveDataContext/UserPriority" />
@@ -299,12 +279,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(13.25 : 8.84699625651042); (13.875 : 8.84699625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
-      <AssociationMoniker Name="/HiveDataContext/Project/Project_AssignedResource" />
-      <nodes>
-        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
-        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
-      </nodes>
-    </associationConnector>
-    <associationConnector edgePoints="[(11.25 : 9.42390055338542); (10.375 : 9.42390055338542); (10.375 : 8); (4 : 8); (4 : 5.15549967447917); (5.125 : 5.15549967447917); (5.125 : 4.78049967447917)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(11.25 : 9.42390055338542); (10.375 : 9.42390055338542); (10.375 : 8); (4 : 8); (4 : 4.9631982421875); (5.125 : 4.9631982421875); (5.125 : 4.5881982421875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
       <nodes>
@@ -326,9 +299,23 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(12.25 : 2.9631982421875); (12.25 : 3.8125); (11.1875 : 3.8125); (11.1875 : 4.97199625651042); (10.875 : 4.97199625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(12.25 : 2.9631982421875); (12.25 : 4.97199625651042); (10.875 : 4.97199625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedTaskResource" />
       <nodes>
         <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
         <classShapeMoniker Id="72ac5c1b-0fdf-43a1-bbe7-3774893b40af" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(13.25 : 2.15469482421875); (15.71875 : 2.15469482421875); (15.71875 : 8.25)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedProjectResource" />
+      <nodes>
+        <classShapeMoniker Id="706a4581-6daf-4e71-ae2a-87d50b27a051" />
+        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(13.25 : 8.84699625651042); (13.875 : 8.84699625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/HiveDataContext/Project/Project_AssignedProjectResource" />
+      <nodes>
+        <classShapeMoniker Id="30778876-b5f6-4a97-9ec7-792011973d75" />
+        <classShapeMoniker Id="a929c9dc-69f4-4488-ba1c-a2342bf81d89" />
       </nodes>
     </associationConnector>
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 15526)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 15527)
@@ -67,7 +67,4 @@
     partial void UpdateLifecycle(Lifecycle instance);
     partial void DeleteLifecycle(Lifecycle instance);
-    partial void InsertResourcePermission(ResourcePermission instance);
-    partial void UpdateResourcePermission(ResourcePermission instance);
-    partial void DeleteResourcePermission(ResourcePermission instance);
     partial void InsertUserPriority(UserPriority instance);
     partial void UpdateUserPriority(UserPriority instance);
@@ -222,12 +219,4 @@
 		}
 		
-		public System.Data.Linq.Table<ResourcePermission> ResourcePermissions
-		{
-			get
-			{
-				return this.GetTable<ResourcePermission>();
-			}
-		}
-		
 		public System.Data.Linq.Table<UserPriority> UserPriorities
 		{
@@ -938,6 +927,4 @@
 		private EntitySet<StateLog> _StateLogs;
 		
-		private EntitySet<ResourcePermission> _ResourcePermissions;
-		
 		private EntitySet<AssignedTaskResource> _AssignedTaskResources;
 		
@@ -968,5 +955,4 @@
 			this._UptimeCalendars = new EntitySet<Downtime>(new Action<Downtime>(this.attach_UptimeCalendars), new Action<Downtime>(this.detach_UptimeCalendars));
 			this._StateLogs = new EntitySet<StateLog>(new Action<StateLog>(this.attach_StateLogs), new Action<StateLog>(this.detach_StateLogs));
-			this._ResourcePermissions = new EntitySet<ResourcePermission>(new Action<ResourcePermission>(this.attach_ResourcePermissions), new Action<ResourcePermission>(this.detach_ResourcePermissions));
 			this._AssignedTaskResources = new EntitySet<AssignedTaskResource>(new Action<AssignedTaskResource>(this.attach_AssignedTaskResources), new Action<AssignedTaskResource>(this.detach_AssignedTaskResources));
 			this._ParentResource = default(EntityRef<Resource>);
@@ -1150,17 +1136,4 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_ResourcePermission", Storage="_ResourcePermissions", ThisKey="ResourceId", OtherKey="ResourceId")]
-		public EntitySet<ResourcePermission> ResourcePermissions
-		{
-			get
-			{
-				return this._ResourcePermissions;
-			}
-			set
-			{
-				this._ResourcePermissions.Assign(value);
-			}
-		}
-		
 		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedTaskResource", Storage="_AssignedTaskResources", ThisKey="ResourceId", OtherKey="ResourceId")]
 		public EntitySet<AssignedTaskResource> AssignedTaskResources
@@ -1273,16 +1246,4 @@
 		
 		private void detach_StateLogs(StateLog entity)
-		{
-			this.SendPropertyChanging();
-			entity.Resource = null;
-		}
-		
-		private void attach_ResourcePermissions(ResourcePermission entity)
-		{
-			this.SendPropertyChanging();
-			entity.Resource = this;
-		}
-		
-		private void detach_ResourcePermissions(ResourcePermission entity)
 		{
 			this.SendPropertyChanging();
@@ -2480,6 +2441,4 @@
 		private string _Description;
 		
-		private string _ResourceIds;
-		
 		private System.Guid _UserId;
 		
@@ -2504,6 +2463,4 @@
     partial void OnDescriptionChanging(string value);
     partial void OnDescriptionChanged();
-    partial void OnResourceIdsChanging(string value);
-    partial void OnResourceIdsChanged();
     partial void OnOwnerUserIdChanging(System.Guid value);
     partial void OnOwnerUserIdChanged();
@@ -2578,24 +2535,4 @@
 					this.SendPropertyChanged("Description");
 					this.OnDescriptionChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceIds", DbType="VarChar(MAX)")]
-		public string ResourceIds
-		{
-			get
-			{
-				return this._ResourceIds;
-			}
-			set
-			{
-				if ((this._ResourceIds != value))
-				{
-					this.OnResourceIdsChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceIds = value;
-					this.SendPropertyChanged("ResourceIds");
-					this.OnResourceIdsChanged();
 				}
 			}
@@ -3621,155 +3558,4 @@
 					this.SendPropertyChanged("LastCleanup");
 					this.OnLastCleanupChanged();
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-	}
-	
-	[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ResourcePermission")]
-	public partial class ResourcePermission : INotifyPropertyChanging, INotifyPropertyChanged
-	{
-		
-		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
-		
-		private System.Guid _ResourceId;
-		
-		private System.Guid _GrantedUserId;
-		
-		private System.Guid _GrantedByUserId;
-		
-		private EntityRef<Resource> _Resource;
-		
-    #region Extensibility Method Definitions
-    partial void OnLoaded();
-    partial void OnValidate(System.Data.Linq.ChangeAction action);
-    partial void OnCreated();
-    partial void OnResourceIdChanging(System.Guid value);
-    partial void OnResourceIdChanged();
-    partial void OnGrantedUserIdChanging(System.Guid value);
-    partial void OnGrantedUserIdChanged();
-    partial void OnGrantedByUserIdChanging(System.Guid value);
-    partial void OnGrantedByUserIdChanged();
-    #endregion
-		
-		public ResourcePermission()
-		{
-			this._Resource = default(EntityRef<Resource>);
-			OnCreated();
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ResourceId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid ResourceId
-		{
-			get
-			{
-				return this._ResourceId;
-			}
-			set
-			{
-				if ((this._ResourceId != value))
-				{
-					if (this._Resource.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnResourceIdChanging(value);
-					this.SendPropertyChanging();
-					this._ResourceId = value;
-					this.SendPropertyChanged("ResourceId");
-					this.OnResourceIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedUserId", DbType="UniqueIdentifier NOT NULL", IsPrimaryKey=true)]
-		public System.Guid GrantedUserId
-		{
-			get
-			{
-				return this._GrantedUserId;
-			}
-			set
-			{
-				if ((this._GrantedUserId != value))
-				{
-					this.OnGrantedUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._GrantedUserId = value;
-					this.SendPropertyChanged("GrantedUserId");
-					this.OnGrantedUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GrantedByUserId", DbType="UniqueIdentifier NOT NULL")]
-		public System.Guid GrantedByUserId
-		{
-			get
-			{
-				return this._GrantedByUserId;
-			}
-			set
-			{
-				if ((this._GrantedByUserId != value))
-				{
-					this.OnGrantedByUserIdChanging(value);
-					this.SendPropertyChanging();
-					this._GrantedByUserId = value;
-					this.SendPropertyChanged("GrantedByUserId");
-					this.OnGrantedByUserIdChanged();
-				}
-			}
-		}
-		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_ResourcePermission", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true)]
-		public Resource Resource
-		{
-			get
-			{
-				return this._Resource.Entity;
-			}
-			set
-			{
-				Resource previousValue = this._Resource.Entity;
-				if (((previousValue != value) 
-							|| (this._Resource.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._Resource.Entity = null;
-						previousValue.ResourcePermissions.Remove(this);
-					}
-					this._Resource.Entity = value;
-					if ((value != null))
-					{
-						value.ResourcePermissions.Add(this);
-						this._ResourceId = value.ResourceId;
-					}
-					else
-					{
-						this._ResourceId = default(System.Guid);
-					}
-					this.SendPropertyChanged("Resource");
 				}
 			}
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveService.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveService.cs	(revision 15526)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveService.cs	(revision 15527)
@@ -1016,66 +1016,4 @@
     #endregion
 
-    #region ResourcePermission Methods
-    // only for authorized Administrator/ResourceOwner
-    public void GrantResourcePermissions(Guid resourceId, Guid[] grantedUserIds) {
-      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      AuthorizationManager.AuthorizeForResourceAdministration(resourceId);
-      var pm = PersistenceManager;
-      using(new PerformanceLogger("GrantResourcePermissions")) {
-        pm.UseTransaction(() => {
-          var resourceDao = pm.ResourceDao;
-          var resource = resourceDao.GetById(resourceId);
-          var resourcePermissions = resource.ResourcePermissions.ToList();
-          foreach(var id in grantedUserIds) {
-            if(resourcePermissions.All(x => x.GrantedUserId != id)) {
-              resource.ResourcePermissions.Add(new DA.ResourcePermission {
-                GrantedUserId = id,
-                GrantedByUserId = UserManager.CurrentUserId
-              });
-            }
-          }
-          pm.SubmitChanges();
-        });
-      }
-    }
-
-
-    // only for authorized Administrator/ResourceOwner
-    public void RevokeResourcePermissions(Guid resourceId, Guid[] grantedUserIds) {
-      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      AuthorizationManager.AuthorizeForResourceAdministration(resourceId);
-      var pm = PersistenceManager;
-      using(new PerformanceLogger("RevokeResourcePermission")) {
-        pm.UseTransaction(() => {
-          var resourcePermissionDao = pm.ResourcePermissionDao;
-          resourcePermissionDao.DeleteByResourceIdAndGrantedUserId(resourceId, grantedUserIds);
-          pm.SubmitChanges();
-        });
-      }
-    }
-
-
-    // OBSOLETE (change to public if...)
-    // only for authorized Administrator/ResourceOwner/(Sub)ProjectOwner to which the Resource (i.e. resourceId) is assigned
-    private void GrantResourcePermissions(Guid resourceId, Guid projectId, Guid[] grantedUserIds) {
-      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      //AuthorizationManager.AuthorizeForResourceAdministration(resourceId);
-      var pm = PersistenceManager;
-      using (new PerformanceLogger("GrantResourcePermissions")) {
-        pm.UseTransaction(() => {
-          // TODO-JAN
-          pm.SubmitChanges();
-        });
-      }
-    }
-
-    // OBSOLETE (change to public if...)
-    // only for authorized Administrator/ResourceOwner/(Sub)ProjectOwner to which the Resource (i.e. resourceId) is assigned
-    private void RevokeResourcePermissions(Guid resourceId, Guid projectId, Guid[] grantedUserIds) {
-      // TODO-JAN
-    }
-
-    #endregion
-
     #region Downtime Methods
     public Guid AddDowntime(DT.Downtime downtimeDto) {
@@ -1204,54 +1142,10 @@
     //}
 
-   private void CheckTaskPermissions(IPersistenceManager pm, DT.Task task, IEnumerable<Guid> resourceIds) {
+    private void CheckTaskPermissions(IPersistenceManager pm, DT.Task task, IEnumerable<Guid> resourceIds) {
       var jobDao = pm.JobDao;
       var projectDao = pm.ProjectDao;
       var resourceDao = pm.ResourceDao;
-      var resourcePermissionDao = pm.ResourcePermissionDao;
       var projectPermissionDao = pm.ProjectPermissionDao;
       var currentUserId = UserManager.CurrentUserId;
-
-      //// PART 1: user-resource permission check (V1)
-      //// get granted (parent) resources
-      //var allGrantedResourceIds = pm.UseTransaction(() => {
-      //  return resourcePermissionDao.GetAll().ToList()
-      //    .Where(x => x.GrantedUserId == currentUserId
-      //      || UserManager.VerifyUser(currentUserId, new List<Guid> { x.GrantedUserId }))
-      //    .Select(y => y.ResourceId)
-      //    .ToList();
-      //});
-
-      //// get children of granted parent resources
-      //var userGrantedChildResourceIds = pm.UseTransaction(() => {
-      //  return allGrantedResourceIds
-      //  .SelectMany(x => resourceDao.GetResourcesByParentId(x))
-      //  .Select(y => y.ResourceId);
-      //});
-
-      //// join list of parent and child resources
-      //allGrantedResourceIds.AddRange(userGrantedChildResourceIds);
-
-      // PART 1: user-resource permission check (V2)
-      // collect the current currentUserId and all Ids of affiliated groups
-      var userAndGroupIds = new List<Guid> { currentUserId };
-      userAndGroupIds.AddRange(UserManager.GetUserGroupIdsOfUser(currentUserId));
-
-      // get all granted resourceIds
-      var allGrantedResourceIds = resourcePermissionDao.GetByUserAndGroupIds(userAndGroupIds).ToList();
-
-      // get all owned resourceIds (including child resourceIds)
-      var ownedResourceIds = resourceDao.GetAll()
-        .Where(x => x.OwnerUserId == currentUserId)
-        .Select(x => x.ResourceId).ToList();
-      var ownedChildResourceIds = ownedResourceIds.SelectMany(x => resourceDao.GetResourceIdsByParentId(x));
-      ownedResourceIds.AddRange(ownedChildResourceIds);
-
-      // join list of owned into the list with granted resourceIds
-      allGrantedResourceIds.AddRange(ownedResourceIds);
-
-      // check the argument resourceIds against the list of granted (and owned) ones
-      if (resourceIds.Except(allGrantedResourceIds).Any()) {
-        throw new SecurityException(NOT_AUTHORIZED_RESOURCE);
-      }
 
       // PART 2: user-project permission check
@@ -1262,5 +1156,5 @@
       // PART 3: project-resource permission check
       var assignedResourceIds = project.AssignedProjectResources.Select(x => x.ResourceId).ToList();
-      var assignedChildResourceIds = assignedResourceIds.SelectMany(x => resourceDao.GetResourceIdsByParentId(x));
+      var assignedChildResourceIds = assignedResourceIds.SelectMany(x => resourceDao.GetChildResourceIdsById(x));
       assignedResourceIds.AddRange(assignedChildResourceIds);
       if (resourceIds.Except(assignedResourceIds).Any()) {
@@ -1279,18 +1173,18 @@
       var projectDao = pm.ProjectDao;
       var projectBranch = new List<DA.Project>() { project };
-      projectBranch.AddRange(projectDao.GetProjectsByChildId(project.ProjectId));
+      projectBranch.AddRange(projectDao.GetParentProjectsById(project.ProjectId));
       if (projectBranch
         .Select(x => x.OwnerUserId)
         .Contains(UserManager.CurrentUserId)) {
-        return;  
+        return;
       }
 
       // case 3
-      if(project.ProjectPermissions
+      if (project.ProjectPermissions
         .Select(x => x.GrantedUserId)
         .Contains(UserManager.CurrentUserId)) {
         return;
       }
-      if(projectBranch
+      if (projectBranch
         .SelectMany(x => x.ProjectPermissions)
         .Select(x => x.GrantedUserId)
@@ -1308,14 +1202,14 @@
 
       var projectBranch = new List<DA.Project> { project };
-      projectBranch.AddRange(projectDao.GetProjectsByChildId(project.ProjectId));
+      projectBranch.AddRange(projectDao.GetParentProjectsById(project.ProjectId));
       var ownedProjects = projectBranch.Where(x => x.OwnerUserId == UserManager.CurrentUserId).ToList();
 
       // get all assigned resourceIds (including children) of owned projects in this branch
       var assignedResourceIds = ownedProjects.SelectMany(x => x.AssignedProjectResources).Select(x => x.ResourceId).ToList();
-      var assignedChildResourceIds = assignedResourceIds.SelectMany(x => resourceDao.GetResourceIdsByChildId(x));
+      var assignedChildResourceIds = assignedResourceIds.SelectMany(x => resourceDao.GetParentResourceIdsById(x));
       assignedResourceIds.AddRange(assignedChildResourceIds);
 
       // look up if all resourceIds are among the assigned ones
-      if(resourceIds.Except(assignedResourceIds).Any()) {
+      if (resourceIds.Except(assignedResourceIds).Any()) {
         throw new SecurityException(NOT_AUTHORIZED_RESOURCE);
       }
@@ -1336,6 +1230,6 @@
       // check if user is administrator, owner of the project or any parent project
       var projectTree = new List<DA.Project> { project };
-      projectTree.AddRange(projectDao.GetProjectsByChildId(projectId));
-      if(!projectTree.Select(x => x.OwnerUserId).Contains(UserManager.CurrentUserId)
+      projectTree.AddRange(projectDao.GetParentProjectsById(projectId));
+      if (!projectTree.Select(x => x.OwnerUserId).Contains(UserManager.CurrentUserId)
         && !RoleVerifier.IsInRole(HiveRoles.Administrator)) {
         throw new SecurityException(NOT_AUTHORIZED_PROJECT);
@@ -1351,6 +1245,6 @@
       // note: this should be faster than checking all children of the assigned 
       // resource(-groups) for the certain resourceId
-      var parentResourceIds = resourceDao.GetResourceIdsByChildId(resourceId);
-      if(assignedResources.Select(x => x.ResourceId)
+      var parentResourceIds = resourceDao.GetParentResourceIdsById(resourceId);
+      if (assignedResources.Select(x => x.ResourceId)
         .Intersect(parentResourceIds).Count() > 0) {
         return resource;
