Index: branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/AuthenticationManager.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/AuthenticationManager.cs	(revision 7801)
+++ 	(revision )
@@ -1,46 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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.Linq;
-using System.Security.Authentication;
-using System.Web.Security;
-
-namespace HeuristicLab.Services.Hive {
-  public class AuthenticationManager : HeuristicLab.Services.Hive.IAuthenticationManager {
-    public bool IsInRole(string role) {
-      return Roles.IsUserInRole(role);
-    }
-    public bool IsInAnyRole(params string[] roles) {
-      return roles.Any(x => Roles.IsUserInRole(x));
-    }
-    public bool IsInAllRoles(params string[] roles) {
-      return roles.All(x => Roles.IsUserInRole(x));
-    }
-    public void AuthenticateForAnyRole(params string[] roles) {
-      if (!IsInAnyRole(roles))
-        throw new AuthenticationException("Could not authenticate user for any role required.");
-    }
-    public void AuthenticateForAllRoles(params string[] roles) {
-      if (!IsInAllRoles(roles))
-        throw new AuthenticationException("Could not authenticate user for all roles required.");
-    }
-  }
-}
Index: branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs	(revision 8085)
@@ -34,5 +34,5 @@
 
     public void AuthorizeForTask(Guid taskId, DT.Permission requiredPermission) {
-      if (ServiceLocator.Instance.AuthenticationManager.IsInRole(HiveRoles.Slave)) return; // slave-users can access all tasks
+      if (ServiceLocator.Instance.RoleVerifier.IsInRole(HiveRoles.Slave)) return; // slave-users can access all tasks
 
       Permission permission = ServiceLocator.Instance.HiveDao.GetPermissionForTask(taskId, ServiceLocator.Instance.UserManager.CurrentUserId);
@@ -46,4 +46,10 @@
         throw new SecurityException("Current user is not authorized to access task");
     }
+
+    public void AuthorizeForResourceAdministration(Guid resourceId) {
+      Resource resource = DT.Convert.ToEntity(ServiceLocator.Instance.HiveDao.GetResource(resourceId));
+      if (resource.OwnerUserId != ServiceLocator.Instance.UserManager.CurrentUserId && !ServiceLocator.Instance.RoleVerifier.IsInRole(HiveRoles.Administrator))
+        throw new SecurityException("Current user is not authorized to access resource");
+    }
   }
 }
Index: branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/EventManager.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/EventManager.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/EventManager.cs	(revision 8085)
@@ -49,4 +49,5 @@
         SetTimeoutSlavesOffline();
         SetTimeoutTasksWaiting();
+        DeleteObsoleteSlaves();
       }, true);
 
@@ -116,4 +117,12 @@
       }
     }
+
+    /// <summary>
+    /// Searches for slaves that are disposable and deletes them if they were offline for too long
+    /// </summary>
+    private void DeleteObsoleteSlaves() {
+      var slaves = dao.GetSlaves(x => x.IsDisposable.GetValueOrDefault() && x.SlaveState == SlaveState.Offline && (DateTime.Now - x.LastHeartbeat) > HeuristicLab.Services.Hive.Properties.Settings.Default.SweepInterval);
+      foreach (DT.Slave slave in slaves) dao.DeleteSlave(slave.Id);
+    }
   }
 }
Index: branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/UserManager.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/UserManager.cs	(revision 7801)
+++ 	(revision )
@@ -1,43 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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.Web.Security;
-
-namespace HeuristicLab.Services.Hive {
-  public class UserManager : IUserManager {
-    public MembershipUser CurrentUser {
-      get { return Membership.GetUser(); }
-    }
-
-    public Guid CurrentUserId {
-      get { return (Guid)CurrentUser.ProviderUserKey; }
-    }
-
-    public MembershipUser GetUserByName(string username) {
-      return Membership.GetUser(username);
-    }
-
-    public MembershipUser GetUserById(Guid userId) {
-      return Membership.GetUser(userId);
-    }
-  }
-}
