Index: trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs	(revision 902)
+++ trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs	(revision 902)
@@ -0,0 +1,14 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.Hive.Contracts {
+  public class ApplicationConstants {
+    public static string RESPONSE_LOGIN_USER_ALLREADY_ONLINE = "Login.UserAllreadyOnline";
+    public static string RESPONSE_LOGIN_SUCCESS = "Login.Success";
+    public static string RESPONSE_LOGOUT_CLIENT_NOT_REGISTERED = "Logout.ClientNotRegistered";
+    public static string RESPONSE_LOGOUT_SUCCESS = "Logout.Success";
+
+  }
+}
Index: trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/UserGroup.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/UserGroup.cs	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/UserGroup.cs	(revision 902)
@@ -29,5 +29,5 @@
 
   [DataContract]
-  public class UserGroup {
+  public class UserGroup : PermissionOwner {
     [DataMember]
     public long UserGroupId { get; set; }
Index: trunk/sources/HeuristicLab.Hive.Contracts/HeuristicLab.Hive.Contracts.csproj
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/HeuristicLab.Hive.Contracts.csproj	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Contracts/HeuristicLab.Hive.Contracts.csproj	(revision 902)
@@ -70,4 +70,5 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="ApplicationConstants.cs" />
     <Compile Include="BusinessObjects\GrantedPermissions.cs" />
     <Compile Include="BusinessObjects\ClientGroup.cs" />
@@ -96,4 +97,5 @@
     <Compile Include="Response.cs" />
     <Compile Include="ResponseHB.cs" />
+    <Compile Include="ResponseList.cs" />
     <Compile Include="ResponseResultReceived.cs" />
     <Compile Include="TestJob.cs" />
Index: trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IClientManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IClientManager.cs	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IClientManager.cs	(revision 902)
@@ -13,11 +13,11 @@
   public interface IClientManager {
     [OperationContract]
-    List<ClientInfo> GetAllClients();
+    ResponseList<ClientInfo> GetAllClients();
     [OperationContract]
     [ServiceKnownType(typeof (Resource))]
     [ServiceKnownType(typeof(ClientInfo))]
-    List<ClientGroup> GetAllClientGroups();
+    ResponseList<ClientGroup> GetAllClientGroups();
     [OperationContract]
-    List<UpTimeStatistics> GetAllUpTimeStatistics();
+    ResponseList<UpTimeStatistics> GetAllUpTimeStatistics();
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IJobManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IJobManager.cs	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IJobManager.cs	(revision 902)
@@ -13,5 +13,5 @@
   public interface IJobManager {
     [OperationContract]
-    List<Job> GetAllJobs();
+    ResponseList<Job> GetAllJobs();
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IUserRoleManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IUserRoleManager.cs	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IUserRoleManager.cs	(revision 902)
@@ -13,9 +13,19 @@
   public interface IUserRoleManager {
     [OperationContract]
-    List<User> GetAllUsers();
+    ResponseList<User> GetAllUsers();
     [OperationContract]
-    void AddNewUser(User user);
+    Response AddNewUser(User user);
     [OperationContract]
-    List<UserGroup> GetAllUserGroups();
+    Response RemoveUser(long userId);
+    [OperationContract]
+    Response AddNewUserGroup(UserGroup userGroup);
+    [OperationContract]
+    Response RemoveUserGroup(long groupId);
+    [OperationContract]
+    ResponseList<UserGroup> GetAllUserGroups();
+    [OperationContract]
+    Response AddUserToGroup(long groupId, long userId);
+    [OperationContract]
+    Response RemoveUserFromGroup(long groupId, long userId);
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Contracts/ResponseJob.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/ResponseJob.cs	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Contracts/ResponseJob.cs	(revision 902)
@@ -1,3 +1,24 @@
-﻿using System;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Linq;
Index: trunk/sources/HeuristicLab.Hive.Contracts/ResponseList.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Contracts/ResponseList.cs	(revision 902)
+++ trunk/sources/HeuristicLab.Hive.Contracts/ResponseList.cs	(revision 902)
@@ -0,0 +1,36 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Linq;
+using System.Text;
+using System.Runtime.Serialization;
+
+namespace HeuristicLab.Hive.Contracts {
+
+  [DataContract]
+  public class ResponseList<T> : Response {
+    [DataMember]
+    public List<T> list { get; set; }
+
+  }
+}
Index: trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs	(revision 902)
@@ -44,5 +44,5 @@
           if (client.State != State.offline) {
             response.Success = false;
-            response.StatusMessage = rm.GetString("UserAllreadyOnline");
+            response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGIN_USER_ALLREADY_ONLINE);
             break;
           } else
@@ -54,5 +54,5 @@
         clientAdapter.UpdateClient(clientInfo);
         response.Success = true;
-        response.StatusMessage = rm.GetString("LoginSuccess");
+        response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGIN_SUCCESS);
       }
 
@@ -97,20 +97,18 @@
                            
     public Response Logout(Guid clientId) {
-      bool clientRemoved = false;
-      foreach (ClientInfo client in clients) {
-        if (client.ClientId.Equals(clientId)) {
-          clients.Remove(client);
-          clientRemoved = true;
-        }
-      }
       Response response = new Response();
       
-      if (clientRemoved) {
-        response.Success = true;
-        response.StatusMessage = "Successfully logged out. Good bye";
-      } else {
+      ClientInfo client = clientAdapter.GetClientById(clientId);
+      if (client == null) {
         response.Success = false;
-        response.StatusMessage = "Sorry, but you weren't logged in";
+        response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGOUT_CLIENT_NOT_REGISTERED);
+        return response;
       }
+      client.State = State.offline;
+      clientAdapter.UpdateClient(client);
+
+      response.Success = true;
+      response.StatusMessage = rm.GetString(ApplicationConstants.RESPONSE_LOGOUT_SUCCESS);
+      
       return response;
     }
Index: trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs	(revision 902)
@@ -5,4 +5,5 @@
 using HeuristicLab.Hive.Contracts.Interfaces;
 using HeuristicLab.Hive.Contracts.BusinessObjects;
+using HeuristicLab.Hive.Contracts;
 
 namespace HeuristicLab.Hive.Server.Core {
@@ -35,14 +36,14 @@
     #region IClientManager Members
 
-    public List<ClientInfo> GetAllClients() {
-      return clients;
+    public ResponseList<ClientInfo> GetAllClients() {
+      return null;
     }
 
-    public List<ClientGroup> GetAllClientGroups() {
-      return clientGroups;
+    public ResponseList<ClientGroup> GetAllClientGroups() {
+      return null;
     }
 
-    public List<UpTimeStatistics> GetAllUpTimeStatistics() {
-      return new List<UpTimeStatistics>();
+    public ResponseList<UpTimeStatistics> GetAllUpTimeStatistics() {
+      return null;
     }
 
Index: trunk/sources/HeuristicLab.Hive.Server.Core/HiveServerMessages.resx
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/HiveServerMessages.resx	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/HiveServerMessages.resx	(revision 902)
@@ -118,8 +118,14 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <data name="LoginSuccess" xml:space="preserve">
+  <data name="Login.ClientNotRegistered" xml:space="preserve">
+    <value>Sorry this client was not registered yet</value>
+  </data>
+  <data name="Login.Success" xml:space="preserve">
     <value>The Login was successfull</value>
   </data>
-  <data name="UserAllreadyOnline" xml:space="preserve">
+  <data name="Logout.Success" xml:space="preserve">
+    <value>You where logged out successfully. Good bye</value>
+  </data>
+  <data name="Logout.UserAllreadyOnline" xml:space="preserve">
     <value>A User with this GUID is allready logged in</value>
   </data>
Index: trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs	(revision 902)
@@ -5,4 +5,5 @@
 using HeuristicLab.Hive.Contracts.Interfaces;
 using HeuristicLab.Hive.Contracts.BusinessObjects;
+using HeuristicLab.Hive.Contracts;
 
 namespace HeuristicLab.Hive.Server.Core {
@@ -21,6 +22,6 @@
     }
 
-    public List<Job> GetAllJobs() {
-      return jobs;
+    public ResponseList<Job> GetAllJobs() {
+      return null;
     }
 
Index: trunk/sources/HeuristicLab.Hive.Server.Core/ServerConsoleFacade.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/ServerConsoleFacade.cs	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/ServerConsoleFacade.cs	(revision 902)
@@ -5,4 +5,5 @@
 using HeuristicLab.Hive.Contracts.Interfaces;
 using HeuristicLab.Hive.Contracts.BusinessObjects;
+using HeuristicLab.Hive.Contracts;
 
 namespace HeuristicLab.Hive.Server.Core {
@@ -14,13 +15,13 @@
     #region IClientManager Members
 
-    public List<ClientInfo> GetAllClients() {
+    public ResponseList<ClientInfo> GetAllClients() {
       return clientManager.GetAllClients();
     }
 
-    public List<ClientGroup> GetAllClientGroups() {
+    public ResponseList<ClientGroup> GetAllClientGroups() {
       return clientManager.GetAllClientGroups();
     }
 
-    public List<UpTimeStatistics> GetAllUpTimeStatistics() {
+    public ResponseList<UpTimeStatistics> GetAllUpTimeStatistics() {
       return clientManager.GetAllUpTimeStatistics();
     }
@@ -30,5 +31,5 @@
     #region IJobManager Members
 
-    public List<HeuristicLab.Hive.Contracts.BusinessObjects.Job> GetAllJobs() {
+    public ResponseList<HeuristicLab.Hive.Contracts.BusinessObjects.Job> GetAllJobs() {
       return jobManager.GetAllJobs();
     }
@@ -38,17 +39,38 @@
     #region IUserRoleManager Members
 
-    public List<HeuristicLab.Hive.Contracts.BusinessObjects.User> GetAllUsers() {
+    public ResponseList<HeuristicLab.Hive.Contracts.BusinessObjects.User> GetAllUsers() {
       return userRoleManager.GetAllUsers();
     }
 
-    public void AddNewUser(User user) {
-      userRoleManager.AddNewUser(user);
+    public Response AddNewUser(User user) {
+      return userRoleManager.AddNewUser(user);
     }
 
-    public List<HeuristicLab.Hive.Contracts.BusinessObjects.UserGroup> GetAllUserGroups() {
+    public ResponseList<HeuristicLab.Hive.Contracts.BusinessObjects.UserGroup> GetAllUserGroups() {
       return userRoleManager.GetAllUserGroups();
     }
 
+    public Response RemoveUser(long userId) {
+      throw new NotImplementedException();
+    }
+
+    public Response AddNewUserGroup(UserGroup userGroup) {
+      throw new NotImplementedException();
+    }
+
+    public Response RemoveUserGroup(long groupId) {
+      throw new NotImplementedException();
+    }
+
+    public Response AddUserToGroup(long groupId, long userId) {
+      throw new NotImplementedException();
+    }
+
+    public Response RemoveUserFromGroup(long groupId, long userId) {
+      throw new NotImplementedException();
+    }
+
     #endregion
+
   }
 }
Index: trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs	(revision 901)
+++ trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs	(revision 902)
@@ -5,4 +5,8 @@
 using HeuristicLab.Hive.Contracts.Interfaces;
 using HeuristicLab.Hive.Contracts.BusinessObjects;
+using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess;
+using System.Resources;
+using System.Reflection;
+using HeuristicLab.Hive.Contracts;
 
 namespace HeuristicLab.Hive.Server.Core {
@@ -12,5 +16,11 @@
     List<UserGroup> userGroups;
 
+    IUserAdapter userAdapter;
+    ResourceManager rm;
+
     public UserRoleManager() {
+      userAdapter = ServiceLocator.GetUserAdapter();
+      rm = new ResourceManager("HiveServerMessages.resx", Assembly.GetExecutingAssembly()); 
+
       users = new List<User>();
       userGroups = new List<UserGroup>();
@@ -26,14 +36,36 @@
     #region IUserRoleManager Members
 
-    public List<User> GetAllUsers() {
-      return users;      
+    public ResponseList<User> GetAllUsers() {
+      return null;      
     }
 
-    public void AddNewUser(User user) {
+    public Response AddNewUser(User user) {
+      User dbUser = userAdapter.GetUserByName(user.Name);
 
+      return null;
     }
 
-    public List<UserGroup> GetAllUserGroups() {
-      return userGroups;
+    public ResponseList<UserGroup> GetAllUserGroups() {
+      return null;
+    }
+
+    public Response RemoveUser(long userId) {
+      return null;
+    }
+
+    public Response AddNewUserGroup(UserGroup userGroup) {
+      return null;
+    }
+
+    public Response RemoveUserGroup(long groupId) {
+      return null;
+    }
+
+    public Response AddUserToGroup(long groupId, long userId) {
+      throw new NotImplementedException();
+    }
+
+    public Response RemoveUserFromGroup(long groupId, long userId) {
+      throw new NotImplementedException();
     }
 
