Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/HiveExperiment.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/HiveExperiment.cs	(revision 6456)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/HiveExperiment.cs	(revision 6457)
@@ -35,4 +35,6 @@
     [DataMember]
     public DateTime? LastAccessed { get; set; }
+    [DataMember]
+    public Permission Permission { get; set; } // the permission for the currently logged in user
 
     /* ==== some computed statistics ==== */
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Permission.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Permission.cs	(revision 6456)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Permission.cs	(revision 6457)
@@ -33,10 +33,10 @@
 
     /// <summary>
-    /// User can also Pause, Stop, Restart experiments
+    /// User can also  experiments
     /// </summary>
     Write,
 
     /// <summary>
-    /// User can also delete experiment
+    /// User can pause, stop, restart, delete experiment. can also grant other 
     /// </summary>
     Full
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs	(revision 6456)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs	(revision 6457)
@@ -110,4 +110,9 @@
     #endregion
 
+    #region HiveExperimentPermission Methods
+    void GrantPermission(Guid hiveExperimentId, Guid grantedUserId, Permission permission);
+    void RevokePermission(Guid hiveExperimentId, Guid grantedUserId);
+    #endregion
+
     #region Login Methods
     [OperationContract]
@@ -199,4 +204,5 @@
     IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
     #endregion
+
   }
 }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs	(revision 6456)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs	(revision 6457)
@@ -31,5 +31,5 @@
     public static HiveDataContext CreateContext(bool longRunning = false) {
       var context = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString);
-      if (longRunning) context.CommandTimeout = (int)Settings.Default.LongRunningDatabaseCommandTimeout.TotalSeconds;      
+      if (longRunning) context.CommandTimeout = (int)Settings.Default.LongRunningDatabaseCommandTimeout.TotalSeconds;
       return context;
     }
@@ -319,4 +319,30 @@
       }
     }
+
+    /// <summary>
+    /// Sets the permissions for a experiment. makes sure that only one permission per user exists.
+    /// </summary>
+    public void SetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedByUserId, Guid grantedUserId, Permission permission) {
+      using (var db = CreateContext()) {
+        HiveExperimentPermission hiveExperimentPermission = db.HiveExperimentPermissions.SingleOrDefault(x => x.HiveExperimentId == hiveExperimentId && x.GrantedUserId == grantedUserId);
+        if (hiveExperimentPermission != null) {
+          if (permission == Permission.NotAllowed) {
+            // not allowed, delete
+            db.HiveExperimentPermissions.DeleteOnSubmit(hiveExperimentPermission);
+          } else {
+            // update
+            hiveExperimentPermission.Permission = permission;
+            hiveExperimentPermission.GrantedByUserId = grantedByUserId; // update grantedByUserId, always the last "granter" is stored
+          }
+        } else {
+          // insert
+          if (permission != Permission.NotAllowed) {
+            hiveExperimentPermission = new HiveExperimentPermission() { HiveExperimentId = hiveExperimentId, GrantedByUserId = grantedByUserId, GrantedUserId = grantedUserId, Permission = permission };
+            db.HiveExperimentPermissions.InsertOnSubmit(hiveExperimentPermission);
+          }
+        }
+        db.SubmitChanges();
+      }
+    }
     #endregion
 
@@ -596,4 +622,7 @@
     public Permission GetPermissionForExperiment(Guid experimentId, Guid userId) {
       using (var db = CreateContext()) {
+        HiveExperiment hiveExperiment = db.HiveExperiments.SingleOrDefault(x => x.HiveExperimentId == experimentId);
+        if (hiveExperiment == null) return Permission.NotAllowed;
+        if (hiveExperiment.OwnerUserId == userId) return Permission.Full;
         HiveExperimentPermission permission = db.HiveExperimentPermissions.SingleOrDefault(p => p.HiveExperimentId == experimentId && p.GrantedUserId == userId);
         return permission != null ? permission.Permission : Permission.NotAllowed;
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs	(revision 6456)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Interfaces/IHiveDao.cs	(revision 6457)
@@ -69,4 +69,5 @@
     void UpdateHiveExperimentPermission(DT.HiveExperimentPermission dto);
     void DeleteHiveExperimentPermission(Guid hiveExperimentId, Guid grantedUserId);
+    void SetHiveExperimentPermission(Guid hiveExperimentId, Guid grantedByUserId, Guid grantedUserId, Permission permission);
     #endregion
 
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockAuthorizationManager.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockAuthorizationManager.cs	(revision 6456)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockAuthorizationManager.cs	(revision 6457)
@@ -24,5 +24,9 @@
 namespace HeuristicLab.Services.Hive.Tests.Mocks {
   public class MockAuthorizationManager : IAuthorizationManager {
-    private Guid userId = new Guid("6C7911A1-46EA-4E51-97DF-5582653AAFCE");
+    public static Guid MockUserId1 = new Guid("6C7911A1-46EA-4E51-97DF-5582653AAFCE");
+    public static Guid MockUserId2 = new Guid("897660EB-C90F-4054-988C-D39D530A0A02");
+    public static Guid MockUserId3 = new Guid("9F7B4EA8-A38D-4BC2-802F-E148AC7A6A87");
+
+    private Guid userId = MockUserId1;
 
     public Guid UserId {
@@ -37,5 +41,8 @@
       // o.k.
     }
-
+    
+    internal void SetUserId(Guid id) {
+      this.userId = id;
+    }
   }
 }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs	(revision 6456)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs	(revision 6457)
@@ -22,4 +22,5 @@
 using HeuristicLab.Services.Hive.DataAccess;
 using HeuristicLab.Services.Hive.Tests.Mocks;
+using System;
 
 namespace HeuristicLab.Services.Hive.Tests {
@@ -35,6 +36,7 @@
     }
 
+    private MockAuthorizationManager mockAuthorizationManager = new MockAuthorizationManager();
     public IAuthorizationManager AuthorizationManager {
-      get { return new MockAuthorizationManager(); }
+      get { return mockAuthorizationManager; }
     }
 
@@ -53,4 +55,11 @@
       get { return defaultServiceLocator.HeartbeatManager; }
     }
+
+    #region Special mocking methods
+    public void SetCurrentUser(Guid id) {
+      mockAuthorizationManager.SetUserId(id);
+    }
+
+    #endregion
   }
 }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs	(revision 6456)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs	(revision 6457)
@@ -26,4 +26,5 @@
 using HeuristicLab.Services.Hive.Common.DataTransfer;
 using HeuristicLab.Services.Hive.Common.ServiceContracts;
+using HeuristicLab.Services.Hive.Tests.Mocks;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
@@ -32,8 +33,11 @@
   [TestClass]
   public class ServiceTests {
+    // use the mock service locator to modify service properties (such as current user)
+    private static MockServiceLocator mockServiceLocator;
 
     [ClassInitialize]
     public static void MyClassInitialize(TestContext testContext) {
-      ServiceLocator.Instance = new MockServiceLocator(ServiceLocator.Instance);
+      mockServiceLocator = new MockServiceLocator(ServiceLocator.Instance);
+      ServiceLocator.Instance = mockServiceLocator;
     }
 
@@ -47,15 +51,8 @@
 
       // create hive experiment
-      DT.HiveExperiment experiment = new DT.HiveExperiment() {
-        Name = "TestExperiment",
-        Description = ""
-      };
+      DT.HiveExperiment experiment = new DT.HiveExperiment() { Name = "TestExperiment", Description = "" };
 
       // create job
-      DT.Job job = new DT.Job() {
-        CoresNeeded = 1,
-        MemoryNeeded = 0,
-        Priority = 0
-      };
+      DT.Job job = new DT.Job() { CoresNeeded = 1, MemoryNeeded = 0, Priority = 0 };
       job.State = JobState.Offline;
       job.StateLog.Add(new StateLog { State = JobState.Offline, DateTime = DateTime.Now });
@@ -78,5 +75,5 @@
       plugin1.DateCreated = DateTime.Now;
       plugin1.Hash = hash;
-      
+
       DT.PluginData pluginData1 = new DT.PluginData();
       pluginData1.FileName = "Tests.MyPlugin-1.0.dll";
@@ -206,8 +203,5 @@
 
       // create hive experiment
-      DT.HiveExperiment experiment = new DT.HiveExperiment() {
-        Name = "TestExperiment",
-        Description = ""
-      };
+      DT.HiveExperiment experiment = new DT.HiveExperiment() { Name = "TestExperiment", Description = "" };
 
       // create parent job
@@ -304,4 +298,69 @@
       service.DeleteSlave(slave.Id);
     }
+
+
+    [TestMethod]
+    public void TestHiveExperimentPermissions() {
+      var service = GetLocalService();
+      mockServiceLocator.SetCurrentUser(MockAuthorizationManager.MockUserId1);
+
+      // create hive experiment
+      DT.HiveExperiment e1 = new DT.HiveExperiment() { Name = "TestExperiment", Description = "" };
+      e1.Id = service.AddHiveExperiment(e1);
+      
+      var e1loaded = service.GetHiveExperiment(e1.Id);
+      Assert.AreEqual(Permission.Full, e1loaded.Permission);
+
+      // change to user2
+      mockServiceLocator.SetCurrentUser(MockAuthorizationManager.MockUserId2);
+      e1loaded = service.GetHiveExperiment(e1.Id);
+      Assert.AreEqual(null, e1loaded); // no access
+
+      // user2 should not be able to grant permissions
+      try {
+        service.GrantPermission(e1.Id, MockAuthorizationManager.MockUserId2, Permission.ReadOnly);
+        Assert.Fail("Should not be possible to grant permission due to missing permission for User2");
+      }
+      catch { /* ok, cool */ }
+
+      // switch back to user1 (owner) and grant user2 permissions
+      mockServiceLocator.SetCurrentUser(MockAuthorizationManager.MockUserId1);
+      service.GrantPermission(e1.Id, MockAuthorizationManager.MockUserId2, Permission.ReadOnly);
+
+      // back to user2
+      mockServiceLocator.SetCurrentUser(MockAuthorizationManager.MockUserId2);
+      e1loaded = service.GetHiveExperiment(e1.Id);
+      Assert.AreEqual(Permission.ReadOnly, e1loaded.Permission);
+
+      // user2 should still not be able to grant permissions
+      try {
+        service.GrantPermission(e1.Id, MockAuthorizationManager.MockUserId2, Permission.ReadOnly);
+        Assert.Fail("Should not be possible to grant permission due to missing permission for User2");
+      }
+      catch { /* ok, cool */ }
+
+      // back to user1
+      mockServiceLocator.SetCurrentUser(MockAuthorizationManager.MockUserId1);
+      service.GrantPermission(e1.Id, MockAuthorizationManager.MockUserId2, Permission.Full);
+
+      // back to user2
+      mockServiceLocator.SetCurrentUser(MockAuthorizationManager.MockUserId2);
+      e1loaded = service.GetHiveExperiment(e1.Id);
+      Assert.AreEqual(Permission.Full, e1loaded.Permission);
+
+      // grant rights to user3, now this should be possible due to full permissions
+      service.GrantPermission(e1.Id, MockAuthorizationManager.MockUserId3, Permission.ReadOnly);
+
+      // back to user1 and revoke rights for user2
+      mockServiceLocator.SetCurrentUser(MockAuthorizationManager.MockUserId1);
+      service.RevokePermission(e1.Id, MockAuthorizationManager.MockUserId2);
+
+      // back to user2
+      mockServiceLocator.SetCurrentUser(MockAuthorizationManager.MockUserId2);
+      e1loaded = service.GetHiveExperiment(e1.Id);
+      Assert.AreEqual(null, e1loaded); // no access
+
+      service.DeleteHiveExperiment(e1.Id);
+    }
   }
 }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Status.aspx
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Status.aspx	(revision 6457)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Status.aspx	(revision 6457)
@@ -0,0 +1,31 @@
+﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Status.aspx.cs" Inherits="Status" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+  <title></title>
+</head>
+<body>
+  <form id="form1" runat="server">
+  <div>
+    Available Cores:
+    <asp:Label ID="availableCoresLabel" runat="server" />
+    <br />
+    Used Cores / Calculating Jobs:
+    <asp:Label ID="usedCoresLabel" runat="server" />
+    <br />
+    Waiting Jobs:
+    <asp:Label ID="waitingJobsLabel" runat="server" />
+    <br />
+    Slaves:
+    <asp:Label ID="slavesLabel" runat="server" />
+    <br />
+    <br />
+    <asp:Label ID="statisticsLabel" runat="server" />
+    <asp:Table ID="Table1" runat="server" Height="64px" Width="75px">
+    </asp:Table>
+    <br />
+  </div>
+  </form>
+</body>
+</html>
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Status.aspx.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Status.aspx.cs	(revision 6457)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Status.aspx.cs	(revision 6457)
@@ -0,0 +1,41 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using HeuristicLab.Services.Hive.DataAccess;
+using HeuristicLab.Services.Hive;
+using HeuristicLab.Services.Hive.Common.DataTransfer;
+using System.Text;
+
+public partial class Status : System.Web.UI.Page {
+  protected void Page_Load(object sender, EventArgs e) {
+    var dao = ServiceLocator.Instance.HiveDao;
+    var onlineSlaves = dao.GetSlaves(x => x.SlaveState == SlaveState.Calculating || x.SlaveState == SlaveState.Idle);
+
+    int availableCores = onlineSlaves.Sum(s => s.Cores.Value);
+    int usedCores = availableCores - onlineSlaves.Sum(s => s.FreeCores.Value);
+    int jobCount = ServiceLocator.Instance.HiveDao.GetJobs(x => x.State == JobState.Waiting).Count();
+
+    this.availableCoresLabel.Text = availableCores.ToString();
+    this.usedCoresLabel.Text = usedCores.ToString();
+    this.waitingJobsLabel.Text = jobCount.ToString();
+
+    slavesLabel.Text = string.Join(", ", onlineSlaves.Select(x => x.Name));
+
+    var stats = dao.GetStatistics(x => x.Timestamp >= DateTime.Now.Subtract(TimeSpan.FromDays(7))).OrderByDescending(x => x.TimeStamp);
+    var sb = new StringBuilder();
+    int i = 0;
+    foreach (var s in stats) {
+      if (i % 60 == 0) { // just ~1 per hour
+        var cores = s.SlaveStatistics.Sum(x => x.Cores);
+        var usdCores = cores - s.SlaveStatistics.Sum(x => x.FreeCores);
+        var execTime = new TimeSpan(s.UserStatistics.Sum(x => x.ExecutionTime.Ticks));
+        sb.AppendLine(string.Format("{0}: Cores: {1}, UsedCores: {2}, TotalExecutionTime: {3}<br/>", s.TimeStamp.ToString(), cores, usdCores, execTime.ToString()));
+      }
+      i++;
+    }
+    statisticsLabel.Text = sb.ToString();
+  }
+}
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs	(revision 6456)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs	(revision 6457)
@@ -44,5 +44,5 @@
     private IAuthorizationManager author {
       get { return ServiceLocator.Instance.AuthorizationManager; }
-    }  
+    }
     private ITransactionManager trans {
       get { return ServiceLocator.Instance.TransactionManager; }
@@ -212,18 +212,26 @@
     public HiveExperiment GetHiveExperiment(Guid id) {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      return dao.GetHiveExperiments(x =>
-        x.HiveExperimentId == id
-        && (x.OwnerUserId == author.UserId || x.HiveExperimentPermissions.Count(hep => hep.Permission != Permission.NotAllowed && hep.GrantedUserId == author.UserId) > 0)
-      ).FirstOrDefault();
+      var hiveExperiment = dao.GetHiveExperiments(x =>
+            x.HiveExperimentId == id
+            && (x.OwnerUserId == author.UserId || x.HiveExperimentPermissions.Count(hep => hep.Permission != Permission.NotAllowed && hep.GrantedUserId == author.UserId) > 0)
+          ).FirstOrDefault();
+      if (hiveExperiment != null) hiveExperiment.Permission = dao.GetPermissionForExperiment(hiveExperiment.Id, author.UserId);
+      return hiveExperiment;
     }
 
     public IEnumerable<HiveExperiment> GetHiveExperiments() {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
-      return dao.GetHiveExperiments(x => x.OwnerUserId == author.UserId || x.HiveExperimentPermissions.Count(hep => hep.Permission != Permission.NotAllowed && hep.GrantedUserId == author.UserId) > 0);
+      var hiveExperiments = dao.GetHiveExperiments(x => x.OwnerUserId == author.UserId || x.HiveExperimentPermissions.Count(hep => hep.Permission != Permission.NotAllowed && hep.GrantedUserId == author.UserId) > 0);
+      foreach (var he in hiveExperiments)
+        he.Permission = dao.GetPermissionForExperiment(he.Id, author.UserId);
+      return hiveExperiments;
     }
 
     public IEnumerable<HiveExperiment> GetAllHiveExperiments() {
       authen.AuthenticateForAnyRole(HiveRoles.Administrator);
-      return dao.GetHiveExperiments(x => true);
+      var hiveExperiments = dao.GetHiveExperiments(x => true);
+      foreach (var he in hiveExperiments)
+        he.Permission = dao.GetPermissionForExperiment(he.Id, author.UserId);
+      return hiveExperiments;
     }
 
@@ -249,4 +257,28 @@
         HiveExperiment he = dao.GetHiveExperiment(hiveExperimentId);
         dao.DeleteHiveExperiment(hiveExperimentId); // child jobs will be deleted by db-trigger
+      });
+    }
+    #endregion
+
+    #region HiveExperimentPermission Methods
+    public void GrantPermission(Guid hiveExperimentId, Guid grantedUserId, Permission permission) {
+      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+      trans.UseTransaction(() => {
+        HiveExperiment he = dao.GetHiveExperiment(hiveExperimentId);
+        if (he == null) throw new FaultException<FaultReason>(new FaultReason("Could not find hiveExperiment with id " + hiveExperimentId));
+        Permission perm = dao.GetPermissionForExperiment(he.Id, author.UserId);
+        if (perm != Permission.Full) throw new FaultException<FaultReason>(new FaultReason("Not allowed to grant permissions for this experiment"));
+        dao.SetHiveExperimentPermission(hiveExperimentId, author.UserId, grantedUserId, permission);
+      });
+    }
+
+    public void RevokePermission(Guid hiveExperimentId, Guid grantedUserId) {
+      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
+      trans.UseTransaction(() => {
+        HiveExperiment he = dao.GetHiveExperiment(hiveExperimentId);
+        if (he == null) throw new FaultException<FaultReason>(new FaultReason("Could not find hiveExperiment with id " + hiveExperimentId));
+        Permission perm = dao.GetPermissionForExperiment(he.Id, author.UserId);
+        if (perm != Permission.Full) throw new FaultException<FaultReason>(new FaultReason("Not allowed to grant permissions for this experiment"));
+        dao.SetHiveExperimentPermission(hiveExperimentId, author.UserId, grantedUserId, Permission.NotAllowed);
       });
     }
@@ -461,4 +493,30 @@
     #endregion
 
+    #region Downtime Methods
+    public Guid AddDowntime(Downtime downtime) {
+      authen.AuthenticateForAnyRole(HiveRoles.Administrator);
+      return trans.UseTransaction(() => dao.AddDowntime(downtime));
+    }
+
+    public void DeleteDowntime(Guid downtimeId) {
+      authen.AuthenticateForAnyRole(HiveRoles.Administrator);
+      trans.UseTransaction(() => {
+        dao.DeleteDowntime(downtimeId);
+      });
+    }
+
+    public void UpdateDowntime(Downtime downtime) {
+      authen.AuthenticateForAnyRole(HiveRoles.Administrator);
+      trans.UseTransaction(() => {
+        dao.UpdateDowntime(downtime);
+      });
+    }
+
+    public IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId) {
+      authen.AuthenticateForAnyRole(HiveRoles.Administrator);
+      return trans.UseTransaction(() => dao.GetDowntimes(x => x.ResourceId == resourceId));
+    }
+    #endregion
+
     #region Helper Methods
     private IEnumerable<Job> GetChildJobs(Guid? parentJobId, bool recursive, bool includeParent) {
@@ -477,30 +535,4 @@
     }
     #endregion
-
-    #region Downtime Methods
-    public Guid AddDowntime(Downtime downtime) {
-      authen.AuthenticateForAnyRole(HiveRoles.Administrator);
-      return trans.UseTransaction(() => dao.AddDowntime(downtime));
-    }
-
-    public void DeleteDowntime(Guid downtimeId) {
-      authen.AuthenticateForAnyRole(HiveRoles.Administrator);
-      trans.UseTransaction(() => {
-        dao.DeleteDowntime(downtimeId);
-      });
-    }
-
-    public void UpdateDowntime(Downtime downtime) {
-      authen.AuthenticateForAnyRole(HiveRoles.Administrator);
-      trans.UseTransaction(() => {
-        dao.UpdateDowntime(downtime);
-      });
-    }
-
-    public IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId) {
-      authen.AuthenticateForAnyRole(HiveRoles.Administrator);
-      return trans.UseTransaction(() => dao.GetDowntimes(x => x.ResourceId == resourceId));
-    }
-    #endregion
   }
 }
