Index: /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/HeuristicLab.Hive.Server.Core-3.2.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/HeuristicLab.Hive.Server.Core-3.2.csproj	(revision 1647)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/HeuristicLab.Hive.Server.Core-3.2.csproj	(revision 1648)
@@ -93,4 +93,5 @@
     <Compile Include="JobManager.cs" />
     <Compile Include="LifecycleManager.cs" />
+    <Compile Include="PermissiveSecurityConstants.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="ServerConsoleFacade.cs" />
@@ -137,4 +138,8 @@
       <Name>HeuristicLab.PluginInfrastructure</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Security.Contracts\3.2\HeuristicLab.Security.Contracts-3.2.csproj">
+      <Project>{D59E852C-F205-4647-8C05-EB9ED1CF44E9}</Project>
+      <Name>HeuristicLab.Security.Contracts-3.2</Name>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/PermissiveSecurityConstants.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/PermissiveSecurityConstants.cs	(revision 1648)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/PermissiveSecurityConstants.cs	(revision 1648)
@@ -0,0 +1,64 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.Hive.Server.Core {
+  /// <summary>
+  /// PermissiveSecurityAction contains the GUIDs for 
+  /// </summary>
+  public static class PermissiveSecurityAction {
+    public static Guid Add_Job {
+      get { return new Guid("A477BEA9-9C05-477f-AD9E-F76C510DDB0B"); }
+    }
+
+    public static Guid Get_AllJobs {
+      get { return new Guid("7FC39A7C-1807-4d76-B847-F0DE9DF0275E"); }
+    }
+
+    public static Guid Get_LastJobResult {
+      get { return new Guid("79E8705E-23F5-4157-A3E5-BBE6CE2C6C01"); }
+    }
+
+    public static Guid Get_AllJobResults {
+      get { return new Guid("F72B9338-22A4-4870-B6A3-14BA38DF3BEF"); }
+    }
+
+    public static Guid Remove_Job {
+      get { return new Guid("FFDB7636-4A31-44b7-B843-289B2E8808BD"); }
+    }
+
+    public static Guid Abort_Job {
+      get { return new Guid("DFACD3D6-E85E-42b7-B4AE-0FB33C598F24"); }
+    }
+
+    public static Guid Request_Snapshot {
+      get { return new Guid("40D41BAA-6495-42c6-82B6-9A7CDB1F30EF"); }
+    }
+
+    public static Guid List_AllClients {
+      get { return new Guid("D8EAC687-BE9A-4266-B410-35674A374462"); }
+    }
+
+    public static Guid List_AllClientGroups {
+      get { return new Guid("29FACE0C-A1CA-428b-A757-7FAABD74AFB8"); }
+    }
+
+    public static Guid Show_Statistics {
+      get { return new Guid("FAEFF433-037E-48b7-9CC7-34C560894304"); }
+    }
+
+    public static Guid Add_ClientGroup {
+      get { return new Guid("81984753-7401-4a4b-B819-BC48BC662B0F"); }
+    }
+
+    public static Guid Add_Resource {
+      get { return new Guid("8C76C1F1-31B6-4c66-BCFF-E92EA00CABF5"); }
+    }
+
+    public static Guid Delete_Resource {
+      get { return new Guid("EC2362E0-0781-493f-8688-76F3CDFEF339"); }
+    }
+  }
+}
+
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ServerConsoleFacade.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ServerConsoleFacade.cs	(revision 1647)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ServerConsoleFacade.cs	(revision 1648)
@@ -27,4 +27,5 @@
 using HeuristicLab.Hive.Contracts.BusinessObjects;
 using HeuristicLab.Hive.Contracts;
+using HeuristicLab.Security.Contracts.Interfaces;
 
 namespace HeuristicLab.Hive.Server.Core {
@@ -36,17 +37,20 @@
       ServiceLocator.GetJobManager();
 
-    private String loginName = null;
+    private IPermissionManager permManager = ServiceLocator.GetPermissionManager();
 
     #region IServerConsoleFacade Members
 
+    public Guid sessionID = Guid.Empty;
+
     public Response Login(string username, string password) {
       Response resp = new Response();
-
-      loginName = username;
-
-      resp.Success = true;
-      resp.StatusMessage =
-        ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_SUCCESS;
-
+      sessionID = permManager.Authenticate(username, password);
+      if (sessionID == Guid.Empty)
+        resp.Success = false;
+      else {
+        resp.Success = true;
+        resp.StatusMessage =
+          ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_SUCCESS;
+      }
       return resp;
     }
@@ -57,25 +61,43 @@
 
     public ResponseList<ClientInfo> GetAllClients() {
-      return clientManager.GetAllClients();
+      if (hasPermission(PermissiveSecurityAction.List_AllClients))
+        return clientManager.GetAllClients();
+      else
+        throw new PermissionException();
     }
 
     public ResponseList<ClientGroup> GetAllClientGroups() {
-      return clientManager.GetAllClientGroups();
+      if (hasPermission(PermissiveSecurityAction.List_AllClientGroups))
+        return clientManager.GetAllClientGroups();
+      else
+        throw new PermissionException();
     }
 
     public ResponseList<UpTimeStatistics> GetAllUpTimeStatistics() {
-      return clientManager.GetAllUpTimeStatistics();
+      if (hasPermission(PermissiveSecurityAction.Show_Statistics))
+        return clientManager.GetAllUpTimeStatistics();
+      else
+        throw new PermissionException();
     }
 
     public Response AddClientGroup(ClientGroup clientGroup) {
-      return clientManager.AddClientGroup(clientGroup);
+      if (hasPermission(PermissiveSecurityAction.Add_ClientGroup))
+        return clientManager.AddClientGroup(clientGroup);
+      else
+        throw new PermissionException();
     }
 
     public Response AddResourceToGroup(Guid clientGroupId, Resource resource) {
-      return clientManager.AddResourceToGroup(clientGroupId, resource);
+      if (hasPermission(PermissiveSecurityAction.Add_Resource))
+        return clientManager.AddResourceToGroup(clientGroupId, resource);
+      else
+        throw new PermissionException();
     }
 
     public Response DeleteResourceFromGroup(Guid clientGroupId, Guid resourceId) {
-      return clientManager.DeleteResourceFromGroup(clientGroupId, resourceId);
+      if (hasPermission(PermissiveSecurityAction.Delete_Resource))
+        return clientManager.DeleteResourceFromGroup(clientGroupId, resourceId);
+      else
+        throw new PermissionException();
     }
 
@@ -85,31 +107,75 @@
 
     public ResponseList<HeuristicLab.Hive.Contracts.BusinessObjects.Job> GetAllJobs() {
-      return jobManager.GetAllJobs();
+      if (hasPermission(PermissiveSecurityAction.Get_AllJobs))
+        return jobManager.GetAllJobs();
+      else
+        throw new PermissionException();
     }
+
     public ResponseObject<Job> AddNewJob(Job job) {
-      return jobManager.AddNewJob(job);
+      if (hasPermission(PermissiveSecurityAction.Add_Job))
+        return jobManager.AddNewJob(job);
+      else
+        throw new PermissionException();
     }
 
     public ResponseObject<JobResult> GetLastJobResultOf(Guid jobId, bool requested) {
-      return jobManager.GetLastJobResultOf(jobId, requested);
+      if (hasPermission(PermissiveSecurityAction.Get_LastJobResult))
+        return jobManager.GetLastJobResultOf(jobId, requested);
+      else
+        throw new PermissionException();
+    }
+
+    public ResponseObject<List<JobResult>> GetAllJobResults(Guid jobId) {
+      if (hasPermission(PermissiveSecurityAction.Get_AllJobResults))
+        return jobManager.GetAllJobResults(jobId);
+      else
+        throw new PermissionException();
     }
 
     public Response RemoveJob(Guid jobId) {
-      return jobManager.RemoveJob(jobId);
+      if (hasPermission(PermissiveSecurityAction.Remove_Job))
+        return jobManager.RemoveJob(jobId);
+      else
+        throw new PermissionException();
     }
 
     public Response RequestSnapshot(Guid jobId) {
-      return jobManager.RequestSnapshot(jobId);
+      if (hasPermission(PermissiveSecurityAction.Request_Snapshot))
+        return jobManager.RequestSnapshot(jobId);
+      else
+        throw new PermissionException();
     }
 
     public Response AbortJob(Guid jobId) {
-      return jobManager.AbortJob(jobId);
+      if (hasPermission(PermissiveSecurityAction.Abort_Job))
+        return jobManager.AbortJob(jobId);
+      else
+        throw new PermissionException();
     }
 
-    public ResponseObject<List<JobResult>> GetAllJobResults(Guid jobId) {
-      throw new NotImplementedException();
+    private bool hasPermission(Guid action) {
+      return true;
+      /*
+      if (sessionID == Guid.Empty)
+        throw new Exception("sessionID is not set! Please check if user is successfully logged on!");
+      return permManager.CheckPermission(sessionID, action, Guid.Empty);
+       */
+    }
+
+    public class PermissionException : Exception {
+      public PermissionException()
+        : base("Current user has insufficent rights for this action!") {
+      }
+
+      public PermissionException(string msg)
+        : base(msg) {
+      }
+
+
     }
 
     #endregion
+
   }
 }
Index: /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ServiceLocator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ServiceLocator.cs	(revision 1647)
+++ /trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ServiceLocator.cs	(revision 1648)
@@ -28,4 +28,5 @@
 using HeuristicLab.DataAccess.Interfaces;
 using System.Data.SqlClient;
+using HeuristicLab.Security.Contracts.Interfaces;
 
 /// <summary>
@@ -47,4 +48,6 @@
 
   private static IScheduler scheduler = null;
+
+  private static IPermissionManager permManager = null;
 
   /// <summary>
@@ -129,3 +132,15 @@
     return scheduler;
   }
+
+  /// <summary>
+  /// Gets the permission manager
+  /// </summary>
+  /// <returns></returns>
+  [MethodImpl(MethodImplOptions.Synchronized)]  
+  public static IPermissionManager GetPermissionManager() {
+    if (permManager == null)
+      permManager = discoveryService.GetInstances<IPermissionManager>()[0];
+    return permManager;
+    
+  }
 }
