Index: /branches/HiveProjectManagement/HeuristicLab.Services.Access.DataAccess/3.3/AccessService.dbml
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Access.DataAccess/3.3/AccessService.dbml	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Access.DataAccess/3.3/AccessService.dbml	(revision 15577)
@@ -1,4 +1,4 @@
 ﻿<?xml version="1.0" encoding="utf-8"?><Database Name="HeuristicLab.ClientManagement" Class="AccessServiceDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
-  <Connection Mode="AppSettings" ConnectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.AccessService" SettingsObjectName="HeuristicLab.Services.Access.DataAccess.Properties.Settings" SettingsPropertyName="HeuristicLab_ClientManagementConnectionString" Provider="System.Data.SqlClient" />
+  <Connection Mode="AppSettings" ConnectionString="Data Source=HIVELAB;Integrated Security=SSPI;Initial Catalog=HeuristicLab.AccessService" SettingsObjectName="HeuristicLab.Services.Access.DataAccess.Properties.Settings" SettingsPropertyName="HeuristicLab_ClientManagementConnectionString" Provider="System.Data.SqlClient" />
   <Table Name="dbo.Resource" Member="Resources">
     <Type Name="Resource" InheritanceCode="Resource" IsInheritanceDefault="true">
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Access/3.3/Interfaces/IUserManager.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Access/3.3/Interfaces/IUserManager.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Access/3.3/Interfaces/IUserManager.cs	(revision 15577)
@@ -33,4 +33,5 @@
     IEnumerable<Guid> GetUserGroupIdsOfUser(Guid userId);
     bool VerifyUser(Guid userId, List<Guid> allowedUserGroups);
+    IEnumerable<DataTransfer.UserGroupMapping> GetUserGroupMapping();
   }
 }
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Access/3.3/UserManager.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Access/3.3/UserManager.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Access/3.3/UserManager.cs	(revision 15577)
@@ -90,4 +90,12 @@
     }
 
+    public IEnumerable<DataTransfer.UserGroupMapping> GetUserGroupMapping() {
+      using (DA.AccessServiceDataContext context = new DA.AccessServiceDataContext()) {
+        var query = from u in context.UserGroupUserGroups
+                    select Convert.ToDto(u);
+        return query.ToList();
+      }
+    }
+
     private bool CheckInGroupHierarchy(Guid userId, Guid group, Dictionary<Guid, Guid> ugMapping, List<DA.UserGroup> groups) {
       //check all subgroups
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedJobResourceDao.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedJobResourceDao.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedJobResourceDao.cs	(revision 15577)
@@ -30,7 +30,15 @@
     }
 
+    public void DeleteByProjectIds(IEnumerable<Guid> projectIds) {
+      string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramProjectIds)) {
+        string queryString = string.Format(DeleteByProjectIdsQueryString, paramProjectIds);
+        DataContext.ExecuteCommand(queryString);
+      }
+    }
+
     public void DeleteByProjectIdsAndUserIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> userIds) {
       string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
-      string paramUserIds = string.Join(",", userIds.Select(x => string.Format("'{0}'", x)));
+      string paramUserIds = string.Join(",", userIds.ToList().Select(x => string.Format("'{0}'", x)));
       if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramUserIds)) {
         string queryString = string.Format(DeleteByProjectIdsAndUserIdsQueryString, paramProjectIds, paramUserIds);
@@ -83,25 +91,34 @@
     #region String queries
     private const string DeleteByProjectIdQueryString = @"
-      DELETE FROM [AssignedJobResource] ajr
-      WHERE ajr.JobId IN
-	      (
-		      SELECT j.JobId
-		      FROM [Job] j
-		      WHERE j.ProjectId = {0}
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
+	      (
+		      SELECT j.JobId
+		      FROM [Job] j
+		      WHERE j.ProjectId = '{0}'
 	      )
     ";
     private const string DeleteByProjectIdAndUserIdsQueryString = @"
-      DELETE FROM [AssignedJobResource] ajr
-      WHERE ajr.JobId IN
-	      (
-		      SELECT j.JobId
-		      FROM [Job] j
-		      WHERE j.ProjectId = {0}
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
+	      (
+		      SELECT j.JobId
+		      FROM [Job] j
+		      WHERE j.ProjectId = '{0}'
           AND j.OwnerUserId IN ({1})
 	      )
     ";
+    private const string DeleteByProjectIdsQueryString = @"
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
+	      (
+		      SELECT j.JobId
+		      FROM [Job] j
+		      WHERE j.ProjectId IN ({0})
+	      )
+    ";
     private const string DeleteByProjectIdsAndUserIdsQueryString = @"
-      DELETE FROM [AssignedJobResource] ajr
-      WHERE ajr.JobId IN
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
 	      (
 		      SELECT j.JobId
@@ -112,16 +129,16 @@
     ";
     private const string DeleteByProjectIdAndResourceIdsQueryString = @"
-      DELETE FROM [AssignedJobResource] ajr
-      WHERE ajr.JobId IN
-	      (
-		      SELECT j.JobId
-		      FROM [Job] j
-		      WHERE j.ProjectId = {0}
-	      )
-      AND ajr.ResourceId IN ({1})
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
+	      (
+		      SELECT j.JobId
+		      FROM [Job] j
+		      WHERE j.ProjectId = '{0}'
+	      )
+      AND ResourceId IN ({1})
     ";
     private const string DeleteByProjectIdsAndResourceIdsQueryString = @"
-      DELETE FROM [AssignedJobResource] ajr
-      WHERE ajr.JobId IN
+      DELETE FROM [AssignedJobResource]
+      WHERE JobId IN
 	      (
 		      SELECT j.JobId
@@ -129,5 +146,5 @@
 		      WHERE j.ProjectId IN ({0})
 	      )
-      AND ajr.ResourceId IN ({1})
+      AND ResourceId IN ({1})
     ";
     private const string CheckJobGrantedForResourceQueryString = @"
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedProjectResourceDao.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedProjectResourceDao.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedProjectResourceDao.cs	(revision 15577)
@@ -38,5 +38,5 @@
 
     public void DeleteByProjectIdAndResourceIds(Guid projectId, IEnumerable<Guid> resourceIds) {
-      string paramIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x)));
+      string paramIds = string.Join(",", resourceIds.ToList().Select(x => string.Format("'{0}'", x)));
       if (!string.IsNullOrWhiteSpace(paramIds)) {
         string query = string.Format(DeleteByProjectIdAndResourceIdsQueryString, projectId, paramIds);
@@ -46,7 +46,7 @@
 
     public void DeleteByProjectIdsAndResourceIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> resourceIds) {
-      string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
-      string paramResourceIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x)));
-      if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
+      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
+      string paramResourceIds = string.Join(",", resourceIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramResourceIds)) {
         string query = string.Format(DeleteByProjectIdsAndResourceIdsQueryString, paramProjectIds, paramResourceIds);
         DataContext.ExecuteCommand(query);
@@ -54,6 +54,14 @@
     }
 
+    public void DeleteByProjectIds(IEnumerable<Guid> projectIds) {
+      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramProjectIds)) {
+        string query = string.Format(DeleteByProjectIdsQueryString, paramProjectIds);
+        DataContext.ExecuteCommand(query);
+      }
+    }
+
     public bool CheckProjectGrantedForResources(Guid projectId, IEnumerable<Guid> resourceIds) {
-      string paramResourceIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x)));
+      string paramResourceIds = string.Join(",", resourceIds.ToList().Select(x => string.Format("'{0}'", x)));
       if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
         string queryString = string.Format(CheckProjectGrantedForResourcesQueryString, projectId, paramResourceIds);
@@ -85,12 +93,18 @@
 
     #region String queries
-    private const string DeleteByProjectIdAndResourceIdsQueryString =
-      @"DELETE FROM [AssignedProjectResource]
-         WHERE ProjectId = '{0}'
-           AND ResourceId IN ({1});";
-    private const string DeleteByProjectIdsAndResourceIdsQueryString =
-      @"DELETE FROM [AssignedProjectResource]
-             WHERE ProjectId IN ({0})
-               AND ResourceId IN ({1});";
+    private const string DeleteByProjectIdAndResourceIdsQueryString = @"
+      DELETE FROM [AssignedProjectResource]
+        WHERE ProjectId = '{0}'
+        AND ResourceId IN ({1});
+    ";
+    private const string DeleteByProjectIdsAndResourceIdsQueryString = @"
+      DELETE FROM [AssignedProjectResource]
+        WHERE ProjectId IN ({0})
+        AND ResourceId IN ({1});
+    ";
+    private const string DeleteByProjectIdsQueryString = @"
+      DELETE FROM [AssignedProjectResource]
+        WHERE ProjectId IN ({0})
+    ";
     private const string CheckProjectGrantedForResourcesQueryString = @"
     WITH rtree AS
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs	(revision 15577)
@@ -33,6 +33,15 @@
     }
 
-    public IEnumerable<Project> GetGrantedProjectsForUser(IEnumerable<Guid> userAndGroupIds) {
-      return GetGrantedProjectsForUserQuery(DataContext, userAndGroupIds);
+    public IEnumerable<Project> GetUsageGrantedProjectsForUser(IEnumerable<Guid> userAndGroupIds) {
+      string paramUserAndGroupIds = string.Join(",", userAndGroupIds.ToList().Select(x => string.Format("'{0}'", x)));
+      if (!string.IsNullOrWhiteSpace(paramUserAndGroupIds)) {
+        string queryString = string.Format(GetUsageGrantedProjectsForUserQueryString, paramUserAndGroupIds);
+        return DataContext.ExecuteQuery<Project>(queryString);
+      }
+      return Enumerable.Empty<Project>();
+    }
+
+    public IEnumerable<Project> GetAdministrationGrantedProjectsForUser(Guid userId) {
+      return DataContext.ExecuteQuery<Project>(GetAdministrationGrantedProjectsForUserQueryString, userId);
     }
 
@@ -67,14 +76,35 @@
          where project.ProjectId == projectId
          select project).SingleOrDefault());
-    private static readonly Func<DataContext, IEnumerable<Guid>, IEnumerable<Project>> GetGrantedProjectsForUserQuery =
-      CompiledQuery.Compile((DataContext db, IEnumerable<Guid> userAndGroupIds) =>
-      (from project in db.GetTable<Project>()
-       join projectPermission in db.GetTable<ProjectPermission>()
-       on project.ProjectId equals projectPermission.ProjectId
-       where userAndGroupIds.Contains(projectPermission.GrantedUserId)
-       select project).Distinct());
     #endregion
 
-      #region String queries
+    #region String queries
+    private const string GetUsageGrantedProjectsForUserQueryString = @"
+      SELECT DISTINCT p.*
+      FROM [Project] p, [ProjectPermission] pp
+      WHERE p.ProjectId = pp.ProjectId
+      AND pp.GrantedUserId IN ({0})
+    ";
+
+    private const string GetAdministrationGrantedProjectsForUserQueryString = @"
+      WITH ptree AS
+      (
+	      SELECT ProjectId, ParentProjectId
+	      FROM [Project]
+	      UNION ALL
+	      SELECT pt.ProjectId, p.ParentProjectId
+	      FROM [Project] p
+	      JOIN ptree pt ON pt.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pt.ParentProjectId <> pt.ProjectId
+      )
+      SELECT DISTINCT parent.*
+      FROM [Project] parent
+      WHERE parent.OwnerUserId = {0}
+      UNION
+      SELECT DISTINCT child.* 
+      FROM ptree, [Project] parent, [Project] child
+      WHERE ptree.ParentProjectId = parent.ProjectId
+      AND ptree.ProjectId = child.ProjectId
+      AND parent.OwnerUserId = {0}
+    ";
+
     private const string GetChildProjectsByIdQuery = @"
     	WITH ptree AS
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectPermissionDao.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectPermissionDao.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectPermissionDao.cs	(revision 15577)
@@ -38,5 +38,5 @@
 
     public bool CheckUserGrantedForProject(Guid projectId, IEnumerable<Guid> userAndGroupIds) {
-      string paramUserAndGroupIds = string.Join(",", userAndGroupIds.Select(x => string.Format("'{0}'", x)));
+      string paramUserAndGroupIds = string.Join(",", userAndGroupIds.ToList().Select(x => string.Format("'{0}'", x)));
       if(!string.IsNullOrWhiteSpace(paramUserAndGroupIds)) {
         string queryString = string.Format(CheckUserGrantedForProjectQueryString, projectId, paramUserAndGroupIds);
@@ -47,5 +47,5 @@
 
     public void DeleteByProjectIdAndGrantedUserIds(Guid projectId, IEnumerable<Guid> grantedUserIds) {
-      string paramIds = string.Join(",", grantedUserIds.Select(x => string.Format("'{0}'", x)));
+      string paramIds = string.Join(",", grantedUserIds.ToList().Select(x => string.Format("'{0}'", x)));
       if (!string.IsNullOrWhiteSpace(paramIds)) {
         string query = string.Format(DeleteByProjectIdAndGrantedUserIdsQueryString, projectId, paramIds);
@@ -55,6 +55,6 @@
 
     public void DeleteByProjectIdsAndGrantedUserIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> grantedUserIds) {
-      string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
-      string paramUserIds = string.Join(",", grantedUserIds.Select(x => string.Format("'{0}'", x)));
+      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
+      string paramUserIds = string.Join(",", grantedUserIds.ToList().Select(x => string.Format("'{0}'", x)));
       if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramUserIds)) {
         string query = string.Format(DeleteByProjectIdsAndGrantedUserIdsQueryString, paramProjectIds, paramUserIds);
@@ -79,5 +79,5 @@
     private const string DeleteByProjectIdsAndGrantedUserIdsQueryString = @"
       DELETE FROM [ProjectPermission]
-      WHERE ProjectId IN '({0})'
+      WHERE ProjectId IN ({0})
       AND GrantedUserId IN ({1});
     ";
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs	(revision 15577)
@@ -38,8 +38,8 @@
 
     public bool CheckExistence(IEnumerable<Guid> ids) {
-      string paramResourceIds = string.Join(",", ids.Select(x => string.Format("'{0}'", x)));
+      string paramResourceIds = string.Join(",", ids.ToList().Select(x => string.Format("'{0}'", x)));
       if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
         string queryString = string.Format(CountExistenceQuery, paramResourceIds);
-        return DataContext.ExecuteQuery<int>(queryString).Count() == ids.Count();
+        return DataContext.ExecuteQuery<int>(queryString).SingleOrDefault() == ids.Count();
       }
       return false;
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj	(revision 15577)
@@ -151,4 +151,5 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <None Include="Properties\AssemblyInfo.cs.frame" />
+    <Compile Include="Settings.cs" />
     <Compile Include="Settings.Designer.cs">
       <AutoGen>True</AutoGen>
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout	(revision 15577)
@@ -81,5 +81,5 @@
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(10.875 : 6.66429768880208); (11.25 : 6.66429768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(10.875 : 6.66429768880208); (11.25 : 6.66429768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
       <nodes>
@@ -88,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>
@@ -134,5 +134,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(7.5 : 4.1170068359375); (7.5 : 5.875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(7.5 : 4.1170068359375); (7.5 : 5.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Task/Task_RequiredPlugin" />
       <nodes>
@@ -279,5 +279,5 @@
       </nodes>
     </associationConnector>
-    <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="NotFixed" fixedTo="Algorithm">
+    <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="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
       <nodes>
@@ -292,5 +292,5 @@
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(8.031252 : 4.1170068359375); (8.031252 : 4.4375); (11.15625 : 4.4375); (11.15625 : 5.09699625651042); (11.25 : 5.09699625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(8.031252 : 4.1170068359375); (8.031252 : 4.4375); (11.15625 : 4.4375); (11.15625 : 5.09699625651042); (11.25 : 5.09699625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Task/Task_AssignedTaskResource" />
       <nodes>
@@ -299,5 +299,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(12.25 : 2.9631982421875); (12.25 : 4.5)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(12.25 : 2.9631982421875); (12.25 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedTaskResource" />
       <nodes>
@@ -333,5 +333,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(5.656252 : 4.5881982421875); (5.656252 : 5.07535062109375); (7.41666666666667 : 5.07535062109375 : JumpStart); (7.58333333333333 : 5.07535062109375 : JumpEnd); (8.875 : 5.07535062109375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(5.656252 : 4.5881982421875); (5.656252 : 5.07535062109375); (8.875 : 5.07535062109375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedJobResource" />
       <nodes>
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs	(revision 15577)
@@ -390,5 +390,5 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedProjectResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedProjectResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true)]
 		public Resource Resource
 		{
@@ -424,5 +424,5 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="CASCADE")]
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteOnNull=true)]
 		public Project Project
 		{
@@ -5809,5 +5809,5 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_AssignedResources", ThisKey="ProjectId", OtherKey="ProjectId")]
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_AssignedResources", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="CASCADE")]
 		public EntitySet<AssignedProjectResource> AssignedProjectResources
 		{
@@ -5848,5 +5848,5 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_ProjectPermissions", ThisKey="ProjectId", OtherKey="ProjectId")]
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_ProjectPermissions", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="CASCADE")]
 		public EntitySet<ProjectPermission> ProjectPermissions
 		{
@@ -6060,5 +6060,5 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
+		[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteOnNull=true)]
 		public Project Project
 		{
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveService.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveService.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveService.cs	(revision 15577)
@@ -764,9 +764,31 @@
         var projectPermissionDao = pm.ProjectPermissionDao;
         var currentUserId = UserManager.CurrentUserId;
-        return pm.UseTransaction(() => {
-          var userAndGroupIds = new List<Guid> { currentUserId };
-          userAndGroupIds.AddRange(UserManager.GetUserGroupIdsOfUser(currentUserId));
-          return projectDao.GetGrantedProjectsForUser(userAndGroupIds)
-            .Select(x => x.ToDto());
+        var userAndGroupIds = new List<Guid> { currentUserId };
+        userAndGroupIds.AddRange(UserManager.GetUserGroupIdsOfUser(currentUserId));
+        return pm.UseTransaction(() => {
+          return projectDao.GetUsageGrantedProjectsForUser(userAndGroupIds)
+            .Select(x => x.ToDto()).ToList();
+        });
+      }
+    }
+
+    public IEnumerable<DT.Project> GetProjectsForAdministration() {
+      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+      bool isAdministrator = RoleVerifier.IsInRole(HiveRoles.Administrator);
+      var pm = PersistenceManager;
+      using (new PerformanceLogger("GetProjectsForAdministration")) {
+        var projectDao = pm.ProjectDao;
+        //var projectPermissionDao = pm.ProjectPermissionDao;
+        
+        return pm.UseTransaction(() => {
+          if(isAdministrator) {
+            return projectDao.GetAll().Select(x => x.ToDto()).ToList();
+          } else {
+            var currentUserId = UserManager.CurrentUserId;
+            return projectDao.GetAdministrationGrantedProjectsForUser(currentUserId)
+              .Select(x => x.ToDto()).ToList();
+
+          }
+
           //var projectPermissions = projectPermissionDao.GetAll();
           //return projectDao.GetAll().ToList()
@@ -786,16 +808,35 @@
 
     #region ProjectPermission Methods
-    public void GrantProjectPermissions(Guid projectId, Guid[] grantedUserIds, bool cascading) {
-      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+    public void SaveProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading) {
+      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+      if (projectId == null || grantedUserIds == null) return;
       AuthorizationManager.AuthorizeForProjectAdministration(projectId);
       var pm = PersistenceManager;
       using (new PerformanceLogger("GrantProjectPermissions")) {
         var projectDao = pm.ProjectDao;
+        var projectPermissionDao = pm.ProjectPermissionDao;
+        var assignedJobResourceDao = pm.AssignedJobResourceDao;
 
         pm.UseTransaction(() => {
           var project = projectDao.GetById(projectId);
-          var projectPermissions = project.ProjectPermissions.ToList();
+          var projectPermissions = project.ProjectPermissions.Select(x => x.GrantedUserId);
+          var addedPermissions = grantedUserIds.Except(projectPermissions);
+          var removedPermissions = projectPermissions.Except(grantedUserIds);
+
+          // remove job assignments and project permissions
+          if (reassign) {
+            assignedJobResourceDao.DeleteByProjectId(project.ProjectId);
+            project.ProjectPermissions.Clear();
+          } else {
+            assignedJobResourceDao.DeleteByProjectIdAndUserIds(project.ProjectId, removedPermissions);
+            foreach(var item in project.ProjectPermissions.ToList().Where(x => removedPermissions.Contains(x.GrantedUserId))) {
+              project.ProjectPermissions.Remove(item);
+            }
+          }
+          pm.SubmitChanges();
+
+          // add project permissions
           foreach (var id in grantedUserIds) {
-            if (projectPermissions.All(x => x.GrantedUserId != id)) {
+            if(project.ProjectPermissions.All(x => x.GrantedUserId != id)) {
               project.ProjectPermissions.Add(new DA.ProjectPermission {
                 GrantedUserId = id,
@@ -804,13 +845,36 @@
             }
           }
+          pm.SubmitChanges();
+
           if (cascading) {
-            var childProjects = projectDao.GetChildProjectsById(projectId);
-            foreach (var p in childProjects) {
-              p.ProjectPermissions.Clear();
+            var childProjects = projectDao.GetChildProjectsById(projectId).ToList();
+            var childProjectIds = childProjects.Select(x => x.ProjectId).ToList();
+
+            // remove job assignments
+            if (reassignCascading) {
+              assignedJobResourceDao.DeleteByProjectIds(childProjectIds);
+            } else {
+              assignedJobResourceDao.DeleteByProjectIdsAndUserIds(childProjectIds, removedPermissions);
+            }
+
+            foreach(var p in childProjects) {
+              // remove project permissions
+              if(reassignCascading) {
+                p.AssignedProjectResources.Clear();
+              } else {
+                foreach(var item in p.ProjectPermissions.ToList().Where(x => removedPermissions.Contains(x.GrantedUserId))) {
+                  p.ProjectPermissions.Remove(item);
+                }
+              }
+              pm.SubmitChanges();
+
+              // add project permissions
               foreach (var id in grantedUserIds) {
-                p.ProjectPermissions.Add(new DA.ProjectPermission {
-                  GrantedUserId = id,
-                  GrantedByUserId = UserManager.CurrentUserId
-                });
+                if (p.ProjectPermissions.All(x => x.GrantedUserId != id)) {
+                  p.ProjectPermissions.Add(new DA.ProjectPermission {
+                    GrantedUserId = id,
+                    GrantedByUserId = UserManager.CurrentUserId
+                  });
+                }
               }
             }
@@ -821,6 +885,11 @@
     }
 
-    public void RevokeProjectPermissions(Guid projectId, Guid[] grantedUserIds, bool cascading) {
-      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+    public void GrantProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading) {
+      throw new NotImplementedException();
+    }
+
+    public void RevokeProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading) {
+      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+      if (projectId == null || grantedUserIds == null || !grantedUserIds.Any()) return;
       AuthorizationManager.AuthorizeForProjectAdministration(projectId);
       var pm = PersistenceManager;
@@ -831,5 +900,5 @@
         pm.UseTransaction(() => {
           if (cascading) {
-            var childProjectIds = projectDao.GetChildProjectIdsById(projectId);
+            var childProjectIds = projectDao.GetChildProjectIdsById(projectId).ToList();
             projectPermissionDao.DeleteByProjectIdsAndGrantedUserIds(childProjectIds, grantedUserIds);
             assignedJobResourceDao.DeleteByProjectIdsAndUserIds(childProjectIds, grantedUserIds);
@@ -857,16 +926,40 @@
 
     #region AssignedProjectResource Methods
-    public void AssignProjectResources(Guid projectId, Guid[] resourceIds, bool cascading) {
-      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+    // basic: remove and add assignments (resourceIds) to projectId and its depending jobs
+    // reassign: clear all assignments from project and its depending jobs, before adding new ones (resourceIds)
+    // cascading: "basic" mode for child-projects
+    // reassignCascading: "reassign" mode for child-projects
+    public void SaveProjectResourceAssignments(Guid projectId, List<Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading) {
+      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+      if (projectId == null || resourceIds == null) return;
       AuthorizationManager.AuthorizeForProjectResourceAdministration(projectId, resourceIds);
       var pm = PersistenceManager;
       using (new PerformanceLogger("AssignProjectResources")) {
         var projectDao = pm.ProjectDao;
+        var assignedProjectResourceDao = pm.AssignedProjectResourceDao;
+        var assignedJobResourceDao = pm.AssignedJobResourceDao;
         pm.UseTransaction(() => {
           var project = projectDao.GetById(projectId);
-          var assignedProjectResources = project.AssignedProjectResources.ToList();
-
+          var assignedResources = project.AssignedProjectResources.Select(x => x.ResourceId);
+          var addedAssignments = resourceIds.Except(assignedResources);
+          var removedAssignments = assignedResources.Except(resourceIds);
+
+          // remove job and project assignments
+          if (reassign) {
+            assignedJobResourceDao.DeleteByProjectId(project.ProjectId);
+            //assignedProjectResourceDao.DeleteByProjectIds(new List<Guid> { projectId });
+            project.AssignedProjectResources.Clear();
+          } else {
+            assignedJobResourceDao.DeleteByProjectIdAndResourceIds(projectId, removedAssignments);
+            //assignedProjectResourceDao.DeleteByProjectIdAndResourceIds(projectId, removedAssignments);
+            foreach (var item in project.AssignedProjectResources.ToList().Where(x => removedAssignments.Contains(x.ResourceId))) {
+              project.AssignedProjectResources.Remove(item);
+            }
+          }
+          pm.SubmitChanges();
+
+          // add project assignments
           foreach (var id in resourceIds) {
-            if (assignedProjectResources.All(x => x.ResourceId != id)) {
+            if (project.AssignedProjectResources.All(x => x.ResourceId != id)) {
               project.AssignedProjectResources.Add(new DA.AssignedProjectResource {
                 ResourceId = id
@@ -874,12 +967,36 @@
             }
           }
+          pm.SubmitChanges();
+
           if (cascading) {
-            var childProjects = projectDao.GetChildProjectsById(projectId);
+            var childProjects = projectDao.GetChildProjectsById(projectId).ToList();
+
+            // remove job assignments
+            if (reassignCascading) {
+              assignedJobResourceDao.DeleteByProjectIds(childProjects.Select(x => x.ProjectId).ToList());
+            } else {
+              var childProjectIds = childProjects.Select(x => x.ProjectId).ToList();
+              assignedJobResourceDao.DeleteByProjectIdsAndResourceIds(childProjectIds, removedAssignments);
+            }
             foreach (var p in childProjects) {
-              p.AssignedProjectResources.Clear();
+              // remove project assignments
+              if (reassignCascading) {
+                //assignedProjectResourceDao.DeleteByProjectIds(new List<Guid> { p.ProjectId });
+                p.AssignedProjectResources.Clear();
+              } else {
+                //assignedProjectResourceDao.DeleteByProjectIdAndResourceIds(p.ProjectId, removedAssignments);
+                foreach (var item in p.AssignedProjectResources.ToList().Where(x => removedAssignments.Contains(x.ResourceId))) {
+                  p.AssignedProjectResources.Remove(item);
+                }
+              }
+              pm.SubmitChanges();
+
+              // add project assignments
               foreach (var id in resourceIds) {
-                p.AssignedProjectResources.Add(new DA.AssignedProjectResource {
-                  ResourceId = id
-                });
+                if(p.AssignedProjectResources.All(x => x.ResourceId != id)) {
+                  p.AssignedProjectResources.Add(new DA.AssignedProjectResource {
+                    ResourceId = id
+                  });
+                }
               }
             }
@@ -890,6 +1007,13 @@
     }
 
-    public void UnassignProjectResources(Guid projectId, Guid[] resourceIds, bool cascading) {
-      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+    public void AssignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading) {
+      throw new NotImplementedException();
+    }
+
+    // basic: unassign resourceIds from project and depending jobs
+    // cascading: unassign resourceIds from all child-projects and their depending jobs
+    public void UnassignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading) {
+      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+      if (projectId == null || resourceIds == null || !resourceIds.Any()) return;
       AuthorizationManager.AuthorizeForProjectResourceAdministration(projectId, resourceIds);
       var pm = PersistenceManager;
@@ -900,5 +1024,5 @@
         pm.UseTransaction(() => {
           if (cascading) {
-            var childProjectIds = projectDao.GetChildProjectIdsById(projectId);
+            var childProjectIds = projectDao.GetChildProjectIdsById(projectId).ToList();
             assignedProjectResourceDao.DeleteByProjectIdsAndResourceIds(childProjectIds, resourceIds);
             assignedJobResourceDao.DeleteByProjectIdsAndResourceIds(childProjectIds, resourceIds);
@@ -970,19 +1094,25 @@
       using (new PerformanceLogger("GetSlaves")) {
         var slaveDao = pm.SlaveDao;
-        var resourcePermissionDao = pm.ProjectPermissionDao;
+        //var projectPermissionDao = pm.ProjectPermissionDao;
         var currentUserId = UserManager.CurrentUserId;
         return pm.UseTransaction(() => {
-          var resourcePermissions = resourcePermissionDao.GetAll();
-          return slaveDao.GetAll().ToList()
-            .Where(x => isAdministrator
-              || x.OwnerUserId == null
-              || x.OwnerUserId == currentUserId
-              || UserManager.VerifyUser(currentUserId, resourcePermissions
-                  //.Where(y => y.ResourceId == x.ResourceId)
-                  .Select(z => z.GrantedUserId)
-                  .ToList())
-              )
-            .Select(x => x.ToDto())
-            .ToList();
+            return slaveDao.GetAll().ToList()
+              .Where( x => isAdministrator
+              || x.OwnerUserId == null 
+              || x.OwnerUserId == currentUserId)
+              .Select(x => x.ToDto())
+              .ToList();
+          //var projectPermissions = projectPermissionDao.GetAll();
+          //return slaveDao.GetAll().ToList()
+          //  .Where(x => isAdministrator
+          //    || x.OwnerUserId == null
+          //    || x.OwnerUserId == currentUserId
+          //    || UserManager.VerifyUser(currentUserId, projectPermissions
+          //        //.Where(y => y.ResourceId == x.ResourceId)
+          //        .Select(z => z.GrantedUserId)
+          //        .ToList())
+          //    )
+          //  .Select(x => x.ToDto())
+          //  .ToList();
         });
       }
@@ -995,17 +1125,17 @@
       using (new PerformanceLogger("GetSlaveGroups")) {
         var slaveGroupDao = pm.SlaveGroupDao;
-        var resourcePermissionDao = pm.ProjectPermissionDao;
+        var projectPermissionDao = pm.ProjectPermissionDao;
         var currentUserId = UserManager.CurrentUserId;
         return pm.UseTransaction(() => {
-          var resourcePermissions = resourcePermissionDao.GetAll();
+          //var projectPermissions = projectPermissionDao.GetAll();
           return slaveGroupDao.GetAll().ToList()
             .Where(x => isAdministrator
               || x.OwnerUserId == null
               || x.OwnerUserId == currentUserId
-              || UserManager.VerifyUser(currentUserId, resourcePermissions
-                  //.Where(y => y.ResourceId == x.ResourceId)
-                  .Select(z => z.GrantedUserId)
-                  .ToList())
-              )
+              //|| UserManager.VerifyUser(currentUserId, projectPermissions
+              //    //.Where(y => y.ResourceId == x.ResourceId)
+              //    .Select(z => z.GrantedUserId)
+              //    .ToList())
+             )
             .Select(x => x.ToDto())
             .ToList();
@@ -1220,4 +1350,20 @@
       var user = ServiceLocator.Instance.UserManager.GetUserByName(username);
       return user != null ? (Guid?)user.ProviderUserKey ?? Guid.Empty : Guid.Empty;
+    }
+    
+    public Dictionary<Guid, HashSet<Guid>> GetUserGroupTree() {
+      var userGroupTree = new Dictionary<Guid, HashSet<Guid>>();
+      var userGroupMapping = UserManager.GetUserGroupMapping();
+
+      foreach(var ugm in userGroupMapping) {
+        if (ugm.Parent == null || ugm.Child == null) continue;
+
+        if (!userGroupTree.ContainsKey(ugm.Parent)) {
+          userGroupTree.Add(ugm.Parent, new HashSet<Guid>());
+        }
+        userGroupTree[ugm.Parent].Add(ugm.Child);
+      }
+
+      return userGroupTree;
     }
     #endregion
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs	(revision 15577)
@@ -75,4 +75,5 @@
     // authorize if user is admin or resource owner
     public void AuthorizeForResourceAdministration(Guid resourceId) {
+      var currentUserId = UserManager.CurrentUserId;
       var pm = PersistenceManager;
       var resourceDao = pm.ResourceDao;
@@ -81,5 +82,5 @@
         if (resource == null) throw new SecurityException(NOT_AUTHORIZED_USERRESOURCE);
 
-        if (resource.OwnerUserId != UserManager.CurrentUserId
+        if (resource.OwnerUserId != currentUserId
             && !RoleVerifier.IsInRole(HiveRoles.Administrator)) {
           throw new SecurityException(NOT_AUTHORIZED_USERRESOURCE);
@@ -90,4 +91,6 @@
     // authorize if user is admin, project owner or owner of a parent project
     public void AuthorizeForProjectAdministration(Guid projectId) {
+      if (projectId == null) return;
+      var currentUserId = UserManager.CurrentUserId;
       var pm = PersistenceManager;
       var projectDao = pm.ProjectDao;
@@ -98,5 +101,5 @@
 
         var projectBranch = projectDao.GetCurrentAndParentProjectsById(projectId);
-        if(!projectBranch.Select(x => x.OwnerUserId).Contains(UserManager.CurrentUserId)
+        if(!projectBranch.Select(x => x.OwnerUserId).Contains(currentUserId)
             && !RoleVerifier.IsInRole(HiveRoles.Administrator)) {
           throw new SecurityException(NOT_AUTHORIZED_USERPROJECT);
@@ -107,4 +110,6 @@
     // authorize if user is admin, or owner of a parent project, for which the resources are assigned to
     public void AuthorizeForProjectResourceAdministration(Guid projectId, IEnumerable<Guid> resourceIds) {
+      if (projectId == null) return;
+      var currentUserId = UserManager.CurrentUserId;
       var pm = PersistenceManager;
       var projectDao = pm.ProjectDao;
@@ -117,5 +122,5 @@
 
         // check if resourceIds exist
-        if (!resourceDao.CheckExistence(resourceIds))
+        if (resourceIds != null && resourceIds.Any() && !resourceDao.CheckExistence(resourceIds))
           throw new SecurityException(NOT_AUTHORIZED_USERRESOURCE);
 
@@ -123,7 +128,13 @@
         if (RoleVerifier.IsInRole(HiveRoles.Administrator)) return;
 
-        // check if user is owner of a parent project and...
+        // check if user is owner of a parent project
+        var projectBranch = projectDao.GetParentProjectsById(projectId);
+        if (!projectBranch.Select(x => x.OwnerUserId).Contains(currentUserId)
+            && !RoleVerifier.IsInRole(HiveRoles.Administrator)) {
+          throw new SecurityException(NOT_AUTHORIZED_USERPROJECT);
+        }
+
         // check if the all argument resourceIds are among the assigned resources of the owned projects
-        var grantedResourceIds = assignedProjectResourceDao.GetAllGrantedResourceIdsOfOwnedParentProjects(projectId, UserManager.CurrentUserId);
+        var grantedResourceIds = assignedProjectResourceDao.GetAllGrantedResourceIdsOfOwnedParentProjects(projectId, currentUserId);
         if(resourceIds.Except(grantedResourceIds).Any()) {
           throw new SecurityException(NOT_AUTHORIZED_USERRESOURCE);
@@ -134,4 +145,5 @@
     // Check if a project is authorized to use a list of resources
     public void AuthorizeProjectForResourcesUse(Guid projectId, IEnumerable<Guid> resourceIds) {
+      if (projectId == null || resourceIds == null || !resourceIds.Any()) return;
       var pm = PersistenceManager;
       var assignedProjectResourceDao = pm.AssignedProjectResourceDao;
@@ -143,4 +155,5 @@
     // note: administrators and project owner are NOT automatically granted
     public void AuthorizeUserForProjectUse(Guid userId, Guid projectId) {
+      if (userId == null || projectId == null) return;
       var pm = PersistenceManager;
       // collect current and group membership Ids
@@ -166,6 +179,7 @@
 
     private void AuthorizeJob(IPersistenceManager pm, Guid jobId, DT.Permission requiredPermission) {
+      var currentUserId = UserManager.CurrentUserId;
       var requiredPermissionEntity = requiredPermission.ToEntity();
-      DA.Permission permission = GetPermissionForJob(pm, jobId, UserManager.CurrentUserId);
+      DA.Permission permission = GetPermissionForJob(pm, jobId, currentUserId);
       if (permission == Permission.NotAllowed
           || ((permission != requiredPermissionEntity) && requiredPermissionEntity == Permission.Full)) {
Index: /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs
===================================================================
--- /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs	(revision 15576)
+++ /branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs	(revision 15577)
@@ -147,12 +147,18 @@
     [OperationContract]
     IEnumerable<Project> GetProjects();
+
+    [OperationContract]
+    IEnumerable<Project> GetProjectsForAdministration();
     #endregion
 
     #region ProjectPermission Methods
     [OperationContract]
-    void GrantProjectPermissions(Guid projectId, Guid[] grantedUserIds, bool cascading);
-
-    [OperationContract]
-    void RevokeProjectPermissions(Guid projectId, Guid[] grantedUserIds, bool cascading);
+    void SaveProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading);
+
+    [OperationContract]
+    void GrantProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
+
+    [OperationContract]
+    void RevokeProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
 
     [OperationContract]
@@ -162,8 +168,11 @@
     #region AssignedProjectResource Methods
     [OperationContract]
-    void AssignProjectResources(Guid projectId, Guid[] resourceIds, bool cascading);
-
-    [OperationContract]
-    void UnassignProjectResources(Guid projectId, Guid[] resourceIds, bool cascading);
+    void SaveProjectResourceAssignments(Guid projectId, List<Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading);
+
+    [OperationContract]
+    void AssignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
+
+    [OperationContract]
+    void UnassignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
 
     [OperationContract]
@@ -235,4 +244,7 @@
     [OperationContract]
     Guid GetUserIdByUsername(string username);
+
+    [OperationContract]
+    Dictionary<Guid, HashSet<Guid>> GetUserGroupTree();
     #endregion
 
