Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml	(revision 3969)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml	(revision 3970)
@@ -1,4 +1,4 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
-<Database Class="DataClassesDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
+<Database Class="DataClassesDataContext" Serialization="Unidirectional" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
   <Table Name="" Member="HeuristicLabUsers">
     <Type Name="HeuristicLabUser">
@@ -11,5 +11,5 @@
       <Column Name="Email" Modifier="Virtual" Type="System.String" CanBeNull="false" />
       <Column Name="Comment" Modifier="Virtual" Type="System.String" CanBeNull="false" />
-      <Column Member="Locked" Type="System.Boolean" CanBeNull="false" />
+      <Column Name="Locked" Type="System.Boolean" CanBeNull="false" />
       <Association Name="HeuristicLabUser_HeuristicLabUserRole" Member="HeuristicLabUserRoles" Storage="_HeuristicLabUserRole" ThisKey="ID" OtherKey="HeuristicLabUserID" Type="HeuristicLabUserRole" />
     </Type>
Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml.layout
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml.layout	(revision 3969)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml.layout	(revision 3970)
@@ -21,5 +21,5 @@
       </nestedChildShapes>
     </classShape>
-    <associationConnector edgePoints="[(1.5625 : 3.1651025390625); (1.5625 : 3.625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+    <associationConnector edgePoints="[(1.5625 : 3.1651025390625); (1.5625 : 3.625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/DataClassesDataContext/HeuristicLabUser/HeuristicLabUser_HeuristicLabUserRole" />
       <nodes>
Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.designer.cs
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.designer.cs	(revision 3969)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.designer.cs	(revision 3970)
@@ -19,4 +19,5 @@
 	using System.Linq;
 	using System.Linq.Expressions;
+	using System.Runtime.Serialization;
 	using System.ComponentModel;
 	using System;
@@ -91,4 +92,5 @@
 	
 	[Table(Name="")]
+	[DataContract()]
 	public partial class HeuristicLabUser : INotifyPropertyChanging, INotifyPropertyChanged
 	{
@@ -115,4 +117,6 @@
 		
 		private EntitySet<HeuristicLabUserRole> _HeuristicLabUserRole;
+		
+		private bool serializing;
 		
     #region Extensibility Method Definitions
@@ -120,6 +124,14 @@
     partial void OnValidate(System.Data.Linq.ChangeAction action);
     partial void OnCreated();
+    partial void OnIDChanging(long value);
+    partial void OnIDChanged();
+    partial void OnUserNameChanging(string value);
+    partial void OnUserNameChanged();
     partial void OnPasswordChanging(string value);
     partial void OnPasswordChanged();
+    partial void OnLastPasswordChangedDateChanging(System.DateTime value);
+    partial void OnLastPasswordChangedDateChanged();
+    partial void OnPasswordQuestionChanging(string value);
+    partial void OnPasswordQuestionChanged();
     partial void OnPasswordAnswerChanging(string value);
     partial void OnPasswordAnswerChanged();
@@ -134,9 +146,9 @@
 		public HeuristicLabUser()
 		{
-			this._HeuristicLabUserRole = new EntitySet<HeuristicLabUserRole>(new Action<HeuristicLabUserRole>(this.attach_HeuristicLabUserRole), new Action<HeuristicLabUserRole>(this.detach_HeuristicLabUserRole));
-			OnCreated();
+			this.Initialize();
 		}
 		
 		[Column(Name="id", Storage="_id", AutoSync=AutoSync.OnInsert, IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
+		[DataMember(Order=1)]
 		public long ID
 		{
@@ -145,7 +157,19 @@
 				return this._id;
 			}
+			set
+			{
+				if ((this._id != value))
+				{
+					this.OnIDChanging(value);
+					this.SendPropertyChanging();
+					this._id = value;
+					this.SendPropertyChanged("ID");
+					this.OnIDChanged();
+				}
+			}
 		}
 		
 		[Column(Storage="_UserName", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
+		[DataMember(Order=2)]
 		public virtual string UserName
 		{
@@ -154,7 +178,19 @@
 				return this._UserName;
 			}
+			set
+			{
+				if ((this._UserName != value))
+				{
+					this.OnUserNameChanging(value);
+					this.SendPropertyChanging();
+					this._UserName = value;
+					this.SendPropertyChanged("UserName");
+					this.OnUserNameChanged();
+				}
+			}
 		}
 		
 		[Column(Storage="_Password", CanBeNull=false)]
+		[DataMember(Order=3)]
 		public string Password
 		{
@@ -177,4 +213,5 @@
 		
 		[Column(Storage="_LastPasswordChangedDate", UpdateCheck=UpdateCheck.Never)]
+		[DataMember(Order=4)]
 		public virtual System.DateTime LastPasswordChangedDate
 		{
@@ -183,7 +220,19 @@
 				return this._LastPasswordChangedDate;
 			}
+			set
+			{
+				if ((this._LastPasswordChangedDate != value))
+				{
+					this.OnLastPasswordChangedDateChanging(value);
+					this.SendPropertyChanging();
+					this._LastPasswordChangedDate = value;
+					this.SendPropertyChanged("LastPasswordChangedDate");
+					this.OnLastPasswordChangedDateChanged();
+				}
+			}
 		}
 		
 		[Column(Storage="_PasswordQuestion", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
+		[DataMember(Order=5)]
 		public virtual string PasswordQuestion
 		{
@@ -192,7 +241,19 @@
 				return this._PasswordQuestion;
 			}
+			set
+			{
+				if ((this._PasswordQuestion != value))
+				{
+					this.OnPasswordQuestionChanging(value);
+					this.SendPropertyChanging();
+					this._PasswordQuestion = value;
+					this.SendPropertyChanged("PasswordQuestion");
+					this.OnPasswordQuestionChanged();
+				}
+			}
 		}
 		
 		[Column(Storage="_PasswordAnswer", CanBeNull=false)]
+		[DataMember(Order=6)]
 		public string PasswordAnswer
 		{
@@ -215,4 +276,5 @@
 		
 		[Column(Storage="_Email", CanBeNull=false)]
+		[DataMember(Order=7)]
 		public virtual string Email
 		{
@@ -235,4 +297,5 @@
 		
 		[Column(Storage="_Comment", CanBeNull=false)]
+		[DataMember(Order=8)]
 		public virtual string Comment
 		{
@@ -255,4 +318,5 @@
 		
 		[Column(Storage="_Locked")]
+		[DataMember(Order=9)]
 		public bool Locked
 		{
@@ -275,8 +339,14 @@
 		
 		[Association(Name="HeuristicLabUser_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabUserID")]
+		[DataMember(Order=10, EmitDefaultValue=false)]
 		public EntitySet<HeuristicLabUserRole> HeuristicLabUserRoles
 		{
 			get
 			{
+				if ((this.serializing 
+							&& (this._HeuristicLabUserRole.HasLoadedOrAssignedValues == false)))
+				{
+					return null;
+				}
 				return this._HeuristicLabUserRole;
 			}
@@ -317,8 +387,36 @@
 			this.SendPropertyChanging();
 			entity.HeuristicLabUser = null;
+		}
+		
+		private void Initialize()
+		{
+			this._HeuristicLabUserRole = new EntitySet<HeuristicLabUserRole>(new Action<HeuristicLabUserRole>(this.attach_HeuristicLabUserRole), new Action<HeuristicLabUserRole>(this.detach_HeuristicLabUserRole));
+			OnCreated();
+		}
+		
+		[OnDeserializing()]
+		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
+		public void OnDeserializing(StreamingContext context)
+		{
+			this.Initialize();
+		}
+		
+		[OnSerializing()]
+		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
+		public void OnSerializing(StreamingContext context)
+		{
+			this.serializing = true;
+		}
+		
+		[OnSerialized()]
+		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
+		public void OnSerialized(StreamingContext context)
+		{
+			this.serializing = false;
 		}
 	}
 	
 	[Table(Name="")]
+	[DataContract()]
 	public partial class HeuristicLabRole : INotifyPropertyChanging, INotifyPropertyChanged
 	{
@@ -339,4 +437,6 @@
 		
 		private EntityRef<HeuristicLabRole> _HeuristicLabRole1;
+		
+		private bool serializing;
 		
     #region Extensibility Method Definitions
@@ -344,4 +444,6 @@
     partial void OnValidate(System.Data.Linq.ChangeAction action);
     partial void OnCreated();
+    partial void OnIDChanging(long value);
+    partial void OnIDChanged();
     partial void OnRoleNameChanging(string value);
     partial void OnRoleNameChanged();
@@ -354,4 +456,209 @@
 		public HeuristicLabRole()
 		{
+			this.Initialize();
+		}
+		
+		[Column(Storage="_ID", AutoSync=AutoSync.OnInsert, IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
+		[DataMember(Order=1)]
+		public long ID
+		{
+			get
+			{
+				return this._ID;
+			}
+			set
+			{
+				if ((this._ID != value))
+				{
+					this.OnIDChanging(value);
+					this.SendPropertyChanging();
+					this._ID = value;
+					this.SendPropertyChanged("ID");
+					this.OnIDChanged();
+				}
+			}
+		}
+		
+		[Column(Name="roleName", Storage="_roleName", CanBeNull=false)]
+		[DataMember(Order=2)]
+		public string RoleName
+		{
+			get
+			{
+				return this._roleName;
+			}
+			set
+			{
+				if ((this._roleName != value))
+				{
+					this.OnRoleNameChanging(value);
+					this.SendPropertyChanging();
+					this._roleName = value;
+					this.SendPropertyChanged("RoleName");
+					this.OnRoleNameChanged();
+				}
+			}
+		}
+		
+		[Column(Name="parentRoleID", Storage="_parentRoleID")]
+		[DataMember(Order=3)]
+		public System.Nullable<long> ParentRoleID
+		{
+			get
+			{
+				return this._parentRoleID;
+			}
+			set
+			{
+				if ((this._parentRoleID != value))
+				{
+					this.OnParentRoleIDChanging(value);
+					this.SendPropertyChanging();
+					this._parentRoleID = value;
+					this.SendPropertyChanged("ParentRoleID");
+					this.OnParentRoleIDChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_IsPermission")]
+		[DataMember(Order=4)]
+		public bool IsPermission
+		{
+			get
+			{
+				return this._IsPermission;
+			}
+			set
+			{
+				if ((this._IsPermission != value))
+				{
+					this.OnIsPermissionChanging(value);
+					this.SendPropertyChanging();
+					this._IsPermission = value;
+					this.SendPropertyChanged("IsPermission");
+					this.OnIsPermissionChanged();
+				}
+			}
+		}
+		
+		[Association(Name="HeuristicLabRole_HeuristicLabRole", Storage="_HeuristicLabRole2", ThisKey="ID", OtherKey="ParentRoleID")]
+		[DataMember(Order=5, EmitDefaultValue=false)]
+		public EntitySet<HeuristicLabRole> HeuristicLabRoleChilds
+		{
+			get
+			{
+				if ((this.serializing 
+							&& (this._HeuristicLabRole2.HasLoadedOrAssignedValues == false)))
+				{
+					return null;
+				}
+				return this._HeuristicLabRole2;
+			}
+			set
+			{
+				this._HeuristicLabRole2.Assign(value);
+			}
+		}
+		
+		[Association(Name="HeuristicLabRole_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabRoleID")]
+		[DataMember(Order=6, EmitDefaultValue=false)]
+		public EntitySet<HeuristicLabUserRole> HeuristicLabUserRoles
+		{
+			get
+			{
+				if ((this.serializing 
+							&& (this._HeuristicLabUserRole.HasLoadedOrAssignedValues == false)))
+				{
+					return null;
+				}
+				return this._HeuristicLabUserRole;
+			}
+			set
+			{
+				this._HeuristicLabUserRole.Assign(value);
+			}
+		}
+		
+		[Association(Name="HeuristicLabRole_HeuristicLabRole", Storage="_HeuristicLabRole1", ThisKey="ParentRoleID", OtherKey="ID", IsForeignKey=true)]
+		public HeuristicLabRole HeuristicLabRoleParent
+		{
+			get
+			{
+				return this._HeuristicLabRole1.Entity;
+			}
+			set
+			{
+				HeuristicLabRole previousValue = this._HeuristicLabRole1.Entity;
+				if (((previousValue != value) 
+							|| (this._HeuristicLabRole1.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._HeuristicLabRole1.Entity = null;
+						previousValue.HeuristicLabRoleChilds.Remove(this);
+					}
+					this._HeuristicLabRole1.Entity = value;
+					if ((value != null))
+					{
+						value.HeuristicLabRoleChilds.Add(this);
+						this._parentRoleID = value.ID;
+					}
+					else
+					{
+						this._parentRoleID = default(Nullable<long>);
+					}
+					this.SendPropertyChanged("HeuristicLabRoleParent");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void attach_HeuristicLabRole2(HeuristicLabRole entity)
+		{
+			this.SendPropertyChanging();
+			entity.HeuristicLabRoleParent = this;
+		}
+		
+		private void detach_HeuristicLabRole2(HeuristicLabRole entity)
+		{
+			this.SendPropertyChanging();
+			entity.HeuristicLabRoleParent = null;
+		}
+		
+		private void attach_HeuristicLabUserRole(HeuristicLabUserRole entity)
+		{
+			this.SendPropertyChanging();
+			entity.HeuristicLabRole = this;
+		}
+		
+		private void detach_HeuristicLabUserRole(HeuristicLabUserRole entity)
+		{
+			this.SendPropertyChanging();
+			entity.HeuristicLabRole = null;
+		}
+		
+		private void Initialize()
+		{
 			this._HeuristicLabRole2 = new EntitySet<HeuristicLabRole>(new Action<HeuristicLabRole>(this.attach_HeuristicLabRole2), new Action<HeuristicLabRole>(this.detach_HeuristicLabRole2));
 			this._HeuristicLabUserRole = new EntitySet<HeuristicLabUserRole>(new Action<HeuristicLabUserRole>(this.attach_HeuristicLabUserRole), new Action<HeuristicLabUserRole>(this.detach_HeuristicLabUserRole));
@@ -360,179 +667,28 @@
 		}
 		
-		[Column(Storage="_ID", AutoSync=AutoSync.OnInsert, IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
-		public long ID
-		{
-			get
-			{
-				return this._ID;
-			}
-		}
-		
-		[Column(Name="roleName", Storage="_roleName", CanBeNull=false)]
-		public string RoleName
-		{
-			get
-			{
-				return this._roleName;
-			}
-			set
-			{
-				if ((this._roleName != value))
-				{
-					this.OnRoleNameChanging(value);
-					this.SendPropertyChanging();
-					this._roleName = value;
-					this.SendPropertyChanged("RoleName");
-					this.OnRoleNameChanged();
-				}
-			}
-		}
-		
-		[Column(Name="parentRoleID", Storage="_parentRoleID")]
-		public System.Nullable<long> ParentRoleID
-		{
-			get
-			{
-				return this._parentRoleID;
-			}
-			set
-			{
-				if ((this._parentRoleID != value))
-				{
-					this.OnParentRoleIDChanging(value);
-					this.SendPropertyChanging();
-					this._parentRoleID = value;
-					this.SendPropertyChanged("ParentRoleID");
-					this.OnParentRoleIDChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_IsPermission")]
-		public bool IsPermission
-		{
-			get
-			{
-				return this._IsPermission;
-			}
-			set
-			{
-				if ((this._IsPermission != value))
-				{
-					this.OnIsPermissionChanging(value);
-					this.SendPropertyChanging();
-					this._IsPermission = value;
-					this.SendPropertyChanged("IsPermission");
-					this.OnIsPermissionChanged();
-				}
-			}
-		}
-		
-		[Association(Name="HeuristicLabRole_HeuristicLabRole", Storage="_HeuristicLabRole2", ThisKey="ID", OtherKey="ParentRoleID")]
-		public EntitySet<HeuristicLabRole> HeuristicLabRoleChilds
-		{
-			get
-			{
-				return this._HeuristicLabRole2;
-			}
-			set
-			{
-				this._HeuristicLabRole2.Assign(value);
-			}
-		}
-		
-		[Association(Name="HeuristicLabRole_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabRoleID")]
-		public EntitySet<HeuristicLabUserRole> HeuristicLabUserRoles
-		{
-			get
-			{
-				return this._HeuristicLabUserRole;
-			}
-			set
-			{
-				this._HeuristicLabUserRole.Assign(value);
-			}
-		}
-		
-		[Association(Name="HeuristicLabRole_HeuristicLabRole", Storage="_HeuristicLabRole1", ThisKey="ParentRoleID", OtherKey="ID", IsForeignKey=true)]
-		public HeuristicLabRole HeuristicLabRoleParent
-		{
-			get
-			{
-				return this._HeuristicLabRole1.Entity;
-			}
-			set
-			{
-				HeuristicLabRole previousValue = this._HeuristicLabRole1.Entity;
-				if (((previousValue != value) 
-							|| (this._HeuristicLabRole1.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._HeuristicLabRole1.Entity = null;
-						previousValue.HeuristicLabRoleChilds.Remove(this);
-					}
-					this._HeuristicLabRole1.Entity = value;
-					if ((value != null))
-					{
-						value.HeuristicLabRoleChilds.Add(this);
-						this._parentRoleID = value.ID;
-					}
-					else
-					{
-						this._parentRoleID = default(Nullable<long>);
-					}
-					this.SendPropertyChanged("HeuristicLabRoleParent");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
-		}
-		
-		private void attach_HeuristicLabRole2(HeuristicLabRole entity)
-		{
-			this.SendPropertyChanging();
-			entity.HeuristicLabRoleParent = this;
-		}
-		
-		private void detach_HeuristicLabRole2(HeuristicLabRole entity)
-		{
-			this.SendPropertyChanging();
-			entity.HeuristicLabRoleParent = null;
-		}
-		
-		private void attach_HeuristicLabUserRole(HeuristicLabUserRole entity)
-		{
-			this.SendPropertyChanging();
-			entity.HeuristicLabRole = this;
-		}
-		
-		private void detach_HeuristicLabUserRole(HeuristicLabUserRole entity)
-		{
-			this.SendPropertyChanging();
-			entity.HeuristicLabRole = null;
+		[OnDeserializing()]
+		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
+		public void OnDeserializing(StreamingContext context)
+		{
+			this.Initialize();
+		}
+		
+		[OnSerializing()]
+		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
+		public void OnSerializing(StreamingContext context)
+		{
+			this.serializing = true;
+		}
+		
+		[OnSerialized()]
+		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
+		public void OnSerialized(StreamingContext context)
+		{
+			this.serializing = false;
 		}
 	}
 	
 	[Table(Name="")]
+	[DataContract()]
 	public partial class HeuristicLabUserRole : INotifyPropertyChanging, INotifyPropertyChanged
 	{
@@ -564,4 +720,168 @@
 		public HeuristicLabUserRole()
 		{
+			this.Initialize();
+		}
+		
+		[Column(Storage="_ID", AutoSync=AutoSync.OnInsert, IsPrimaryKey=true, IsDbGenerated=true)]
+		[DataMember(Order=1)]
+		public long ID
+		{
+			get
+			{
+				return this._ID;
+			}
+			set
+			{
+				if ((this._ID != value))
+				{
+					this.OnIDChanging(value);
+					this.SendPropertyChanging();
+					this._ID = value;
+					this.SendPropertyChanged("ID");
+					this.OnIDChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_HeuristicLabUserID")]
+		[DataMember(Order=2)]
+		public long HeuristicLabUserID
+		{
+			get
+			{
+				return this._HeuristicLabUserID;
+			}
+			set
+			{
+				if ((this._HeuristicLabUserID != value))
+				{
+					if (this._HeuristicLabUser.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnHeuristicLabUserIDChanging(value);
+					this.SendPropertyChanging();
+					this._HeuristicLabUserID = value;
+					this.SendPropertyChanged("HeuristicLabUserID");
+					this.OnHeuristicLabUserIDChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_HeuristicLabRoleID")]
+		[DataMember(Order=3)]
+		public long HeuristicLabRoleID
+		{
+			get
+			{
+				return this._HeuristicLabRoleID;
+			}
+			set
+			{
+				if ((this._HeuristicLabRoleID != value))
+				{
+					if (this._HeuristicLabAbstractRole.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnHeuristicLabRoleIDChanging(value);
+					this.SendPropertyChanging();
+					this._HeuristicLabRoleID = value;
+					this.SendPropertyChanged("HeuristicLabRoleID");
+					this.OnHeuristicLabRoleIDChanged();
+				}
+			}
+		}
+		
+		[Association(Name="HeuristicLabUser_HeuristicLabUserRole", Storage="_HeuristicLabUser", ThisKey="HeuristicLabUserID", OtherKey="ID", IsForeignKey=true)]
+		public HeuristicLabUser HeuristicLabUser
+		{
+			get
+			{
+				return this._HeuristicLabUser.Entity;
+			}
+			set
+			{
+				HeuristicLabUser previousValue = this._HeuristicLabUser.Entity;
+				if (((previousValue != value) 
+							|| (this._HeuristicLabUser.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._HeuristicLabUser.Entity = null;
+						previousValue.HeuristicLabUserRoles.Remove(this);
+					}
+					this._HeuristicLabUser.Entity = value;
+					if ((value != null))
+					{
+						value.HeuristicLabUserRoles.Add(this);
+						this._HeuristicLabUserID = value.ID;
+					}
+					else
+					{
+						this._HeuristicLabUserID = default(long);
+					}
+					this.SendPropertyChanged("HeuristicLabUser");
+				}
+			}
+		}
+		
+		[Association(Name="HeuristicLabRole_HeuristicLabUserRole", Storage="_HeuristicLabAbstractRole", ThisKey="HeuristicLabRoleID", OtherKey="ID", IsForeignKey=true)]
+		public HeuristicLabRole HeuristicLabRole
+		{
+			get
+			{
+				return this._HeuristicLabAbstractRole.Entity;
+			}
+			set
+			{
+				HeuristicLabRole previousValue = this._HeuristicLabAbstractRole.Entity;
+				if (((previousValue != value) 
+							|| (this._HeuristicLabAbstractRole.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._HeuristicLabAbstractRole.Entity = null;
+						previousValue.HeuristicLabUserRoles.Remove(this);
+					}
+					this._HeuristicLabAbstractRole.Entity = value;
+					if ((value != null))
+					{
+						value.HeuristicLabUserRoles.Add(this);
+						this._HeuristicLabRoleID = value.ID;
+					}
+					else
+					{
+						this._HeuristicLabRoleID = default(long);
+					}
+					this.SendPropertyChanged("HeuristicLabRole");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+			}
+		}
+		
+		private void Initialize()
+		{
 			this._HeuristicLabUser = default(EntityRef<HeuristicLabUser>);
 			this._HeuristicLabAbstractRole = default(EntityRef<HeuristicLabRole>);
@@ -569,158 +889,9 @@
 		}
 		
-		[Column(Storage="_ID", AutoSync=AutoSync.OnInsert, IsPrimaryKey=true, IsDbGenerated=true)]
-		public long ID
-		{
-			get
-			{
-				return this._ID;
-			}
-			set
-			{
-				if ((this._ID != value))
-				{
-					this.OnIDChanging(value);
-					this.SendPropertyChanging();
-					this._ID = value;
-					this.SendPropertyChanged("ID");
-					this.OnIDChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_HeuristicLabUserID")]
-		public long HeuristicLabUserID
-		{
-			get
-			{
-				return this._HeuristicLabUserID;
-			}
-			set
-			{
-				if ((this._HeuristicLabUserID != value))
-				{
-					if (this._HeuristicLabUser.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnHeuristicLabUserIDChanging(value);
-					this.SendPropertyChanging();
-					this._HeuristicLabUserID = value;
-					this.SendPropertyChanged("HeuristicLabUserID");
-					this.OnHeuristicLabUserIDChanged();
-				}
-			}
-		}
-		
-		[Column(Storage="_HeuristicLabRoleID")]
-		public long HeuristicLabRoleID
-		{
-			get
-			{
-				return this._HeuristicLabRoleID;
-			}
-			set
-			{
-				if ((this._HeuristicLabRoleID != value))
-				{
-					if (this._HeuristicLabAbstractRole.HasLoadedOrAssignedValue)
-					{
-						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
-					}
-					this.OnHeuristicLabRoleIDChanging(value);
-					this.SendPropertyChanging();
-					this._HeuristicLabRoleID = value;
-					this.SendPropertyChanged("HeuristicLabRoleID");
-					this.OnHeuristicLabRoleIDChanged();
-				}
-			}
-		}
-		
-		[Association(Name="HeuristicLabUser_HeuristicLabUserRole", Storage="_HeuristicLabUser", ThisKey="HeuristicLabUserID", OtherKey="ID", IsForeignKey=true)]
-		public HeuristicLabUser HeuristicLabUser
-		{
-			get
-			{
-				return this._HeuristicLabUser.Entity;
-			}
-			set
-			{
-				HeuristicLabUser previousValue = this._HeuristicLabUser.Entity;
-				if (((previousValue != value) 
-							|| (this._HeuristicLabUser.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._HeuristicLabUser.Entity = null;
-						previousValue.HeuristicLabUserRoles.Remove(this);
-					}
-					this._HeuristicLabUser.Entity = value;
-					if ((value != null))
-					{
-						value.HeuristicLabUserRoles.Add(this);
-						this._HeuristicLabUserID = value.ID;
-					}
-					else
-					{
-						this._HeuristicLabUserID = default(long);
-					}
-					this.SendPropertyChanged("HeuristicLabUser");
-				}
-			}
-		}
-		
-		[Association(Name="HeuristicLabRole_HeuristicLabUserRole", Storage="_HeuristicLabAbstractRole", ThisKey="HeuristicLabRoleID", OtherKey="ID", IsForeignKey=true)]
-		public HeuristicLabRole HeuristicLabRole
-		{
-			get
-			{
-				return this._HeuristicLabAbstractRole.Entity;
-			}
-			set
-			{
-				HeuristicLabRole previousValue = this._HeuristicLabAbstractRole.Entity;
-				if (((previousValue != value) 
-							|| (this._HeuristicLabAbstractRole.HasLoadedOrAssignedValue == false)))
-				{
-					this.SendPropertyChanging();
-					if ((previousValue != null))
-					{
-						this._HeuristicLabAbstractRole.Entity = null;
-						previousValue.HeuristicLabUserRoles.Remove(this);
-					}
-					this._HeuristicLabAbstractRole.Entity = value;
-					if ((value != null))
-					{
-						value.HeuristicLabUserRoles.Add(this);
-						this._HeuristicLabRoleID = value.ID;
-					}
-					else
-					{
-						this._HeuristicLabRoleID = default(long);
-					}
-					this.SendPropertyChanged("HeuristicLabRole");
-				}
-			}
-		}
-		
-		public event PropertyChangingEventHandler PropertyChanging;
-		
-		public event PropertyChangedEventHandler PropertyChanged;
-		
-		protected virtual void SendPropertyChanging()
-		{
-			if ((this.PropertyChanging != null))
-			{
-				this.PropertyChanging(this, emptyChangingEventArgs);
-			}
-		}
-		
-		protected virtual void SendPropertyChanged(String propertyName)
-		{
-			if ((this.PropertyChanged != null))
-			{
-				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
-			}
+		[OnDeserializing()]
+		[System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)]
+		public void OnDeserializing(StreamingContext context)
+		{
+			this.Initialize();
 		}
 	}
Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DatabaseUtil.cs
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DatabaseUtil.cs	(revision 3969)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DatabaseUtil.cs	(revision 3970)
@@ -1,3 +1,4 @@
 ﻿using System;
+using System.Diagnostics;
 
 namespace Persistence {
@@ -6,4 +7,16 @@
   /// </summary>
   public class DatabaseUtil {
+
+    protected static bool productionDatabase = true;
+
+    public static bool ProductionDatabase {
+      get {
+        return DatabaseUtil.productionDatabase;
+      }
+      set {
+        DatabaseUtil.productionDatabase = value;
+      }
+    }
+    
     /// <summary>
     /// creates and returns a database connection, if possible
@@ -11,5 +24,9 @@
     /// <returns>database connection (could be null)</returns>
     public static DataClassesDataContext createDataClassesDataContext() {
-        return  new Persistence.DataClassesDataContext(@"C:\TEMP\HeuristicLabTest.mdf");
+      if (productionDatabase) {
+        return new Persistence.DataClassesDataContext(new Persistence.Properties.Settings().DatabaseConnectionString);
+      } else {
+        return new Persistence.DataClassesDataContext(new Persistence.Properties.Settings().DatabaseConnectionStringTesting);
+      }
     }
 
@@ -19,8 +36,5 @@
     /// <param name="db">DataClassesDataContext</param>
     public static void createDatabase(DataClassesDataContext db) {
-      if (db == null) {
-        throw new ArgumentNullException("db");
-      }
-      
+        
       if (db.DatabaseExists()) {
         Console.WriteLine("Deleting old database...");
Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/Persistence.csproj
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/Persistence.csproj	(revision 3969)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/Persistence.csproj	(revision 3970)
@@ -39,4 +39,7 @@
       <RequiredTargetFramework>3.5</RequiredTargetFramework>
     </Reference>
+    <Reference Include="System.Runtime.Serialization">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
     <Reference Include="System.Web" />
     <Reference Include="System.Xml.Linq">
@@ -59,4 +62,9 @@
     <Compile Include="HeuristicLabUser.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+      <DependentUpon>Settings.settings</DependentUpon>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
@@ -71,6 +79,11 @@
   </ItemGroup>
   <ItemGroup>
+    <None Include="app.config" />
     <None Include="DataClasses.dbml.layout">
       <DependentUpon>DataClasses.dbml</DependentUpon>
+    </None>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
     </None>
   </ItemGroup>
Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/Properties/Settings.Designer.cs
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/Properties/Settings.Designer.cs	(revision 3970)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/Properties/Settings.Designer.cs	(revision 3970)
@@ -0,0 +1,48 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     Dieser Code wurde von einem Tool generiert.
+//     Laufzeitversion:2.0.50727.4927
+//
+//     Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
+//     der Code erneut generiert wird.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Persistence.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=169.254.134.244;Initial Catalog=heuristiclab;User ID=sa;Password=gotR" +
+            "oot17344")]
+        public string DatabaseConnectionString {
+            get {
+                return ((string)(this["DatabaseConnectionString"]));
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("c:\\temp\\HeuristicLabUnitTest.mdf")]
+        public string DatabaseConnectionStringTesting {
+            get {
+                return ((string)(this["DatabaseConnectionStringTesting"]));
+            }
+            set {
+                this["DatabaseConnectionStringTesting"] = value;
+            }
+        }
+    }
+}
Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/Properties/Settings.settings
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/Properties/Settings.settings	(revision 3970)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/Properties/Settings.settings	(revision 3970)
@@ -0,0 +1,12 @@
+﻿<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Persistence.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="DatabaseConnectionString" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">Data Source=169.254.134.244;Initial Catalog=heuristiclab;User ID=sa;Password=gotRoot17344</Value>
+    </Setting>
+    <Setting Name="DatabaseConnectionStringTesting" Type="System.String" Scope="User">
+      <Value Profile="(Default)">c:\temp\HeuristicLabUnitTest.mdf</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>
Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/app.config
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/app.config	(revision 3970)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/app.config	(revision 3970)
@@ -0,0 +1,25 @@
+﻿<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+            <section name="Persistence.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+        </sectionGroup>
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+            <section name="Persistence.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
+    <applicationSettings>
+        <Persistence.Properties.Settings>
+            <setting name="DatabaseConnectionString" serializeAs="String">
+                <value>Data Source=169.254.134.244;Initial Catalog=heuristiclab;User ID=sa;Password=gotRoot17344</value>
+            </setting>
+        </Persistence.Properties.Settings>
+    </applicationSettings>
+    <userSettings>
+        <Persistence.Properties.Settings>
+            <setting name="DatabaseConnectionStringTesting" serializeAs="String">
+                <value>c:\temp\HeuristicLabUnitTest.mdf</value>
+            </setting>
+        </Persistence.Properties.Settings>
+    </userSettings>
+</configuration>
Index: /branches/HeuristicLab.Services.Authentication Prototype/Service/App.config
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Service/App.config	(revision 3969)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Service/App.config	(revision 3970)
@@ -4,45 +4,5 @@
     <compilation debug="true" />
   </system.web>
-  <!-- Bei der Bereitstellung des Dienstbibliothekprojekts muss der Inhalt der Konfigurationsdatei der app.config-Datei 
-  des Hosts hinzugefügt werden. System.Configuration unterstützt keine Konfigurationsdateien für Bibliotheken. -->
   <system.serviceModel>
-    <services>
-      <service name="Service.Service1" behaviorConfiguration="Service.Service1Behavior">
-        <host>
-          <baseAddresses>
-            <add baseAddress = "http://localhost:8731/Design_Time_Addresses/Service/Service1/" />
-          </baseAddresses>
-        </host>
-        <!-- Service Endpoints -->
-        <!-- Wenn die Adresse nicht vollqualifiziert ist, ist sie relativ zur oben angegebenen Basisadresse. -->
-        <endpoint address ="" binding="wsHttpBinding" contract="Service.IService1">
-          <!-- 
-              Bei der Bereitstellung muss das folgende Identitätselement entfernt oder ersetzt werden, um die Identität 
-              wiederzugeben, unter der der bereitgestellte Dienst ausgeführt wird. Wenn es entfernt wird, leitet WCF eine geeignete Identität 
-              automatisch ab.
-          -->
-          <identity>
-            <dns value="localhost"/>
-          </identity>
-        </endpoint>
-        <!-- Metadata Endpoints -->
-        <!-- Der Metadatenaustausch-Endpunkt wird von dem Dienst verwendet, um sich gegenüber Clients selbst zu beschreiben. --> 
-        <!-- Dieser Endpunkt verwendet keine sichere Bindung und muss vor der Bereitstellung gesichert oder entfernt werden. -->
-        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
-      </service>
-    </services>
-    <behaviors>
-      <serviceBehaviors>
-        <behavior name="Service.Service1Behavior">
-          <!-- Legen Sie den Wert unten auf "false" fest, um die Veröffentlichung 
-          von Metadateninformationen zu vermeiden, und entfernen Sie den Metadatenendpunkt oben vor der Bereitstellung. -->
-          <serviceMetadata httpGetEnabled="True"/>
-          <!-- Damit in Fehlern Ausnahmedetails zum Debuggen angezeigt werden, 
-          legen Sie den Wert unten auf "true" fest. Legen Sie ihn vor der Bereitstellung auf "false" fest, 
-          um die Veröffentlichung von Ausnahmeinformationen zu vermeiden. -->
-          <serviceDebug includeExceptionDetailInFaults="False" />
-        </behavior>
-      </serviceBehaviors>
-    </behaviors>
-  </system.serviceModel>
+ </system.serviceModel>
 </configuration>
Index: /branches/HeuristicLab.Services.Authentication Prototype/Service/Service.csproj
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Service/Service.csproj	(revision 3969)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Service/Service.csproj	(revision 3970)
@@ -54,9 +54,9 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="IService1.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Provider\HeuristicLabMembershipProvider.cs" />
     <Compile Include="Provider\HeuristicLabRoleProvider.cs" />
-    <Compile Include="Service1.cs" />
+    <Compile Include="Services\Administration\AuthorizationManagementService.cs" />
+    <Compile Include="Services\Administration\IAuthorizationManagementService.cs" />
   </ItemGroup>
   <ItemGroup>
@@ -79,9 +79,4 @@
   <ProjectExtensions>
     <VisualStudio>
-      <FlavorProperties GUID="{3D9AD99F-2412-4246-B90B-4EAA41C64699}">
-        <WcfProjectProperties>
-          <AutoStart>True</AutoStart>
-        </WcfProjectProperties>
-      </FlavorProperties>
     </VisualStudio>
   </ProjectExtensions>
Index: /branches/HeuristicLab.Services.Authentication Prototype/Service/Service.csproj.user
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Service/Service.csproj.user	(revision 3969)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Service/Service.csproj.user	(revision 3970)
@@ -2,12 +2,4 @@
   <ProjectExtensions>
     <VisualStudio>
-      <FlavorProperties GUID="{3D9AD99F-2412-4246-B90B-4EAA41C64699}" xmlns="">
-        <WcfProjectProperties>
-          <PublishCopyOption>RunFiles</PublishCopyOption>
-          <PublishTargetLocation>
-          </PublishTargetLocation>
-          <PublishDeleteAllFiles>False</PublishDeleteAllFiles>
-        </WcfProjectProperties>
-      </FlavorProperties>
     </VisualStudio>
   </ProjectExtensions>
Index: /branches/HeuristicLab.Services.Authentication Prototype/UnitTests/AbstractHeuristicLabTest.cs
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/UnitTests/AbstractHeuristicLabTest.cs	(revision 3969)
+++ /branches/HeuristicLab.Services.Authentication Prototype/UnitTests/AbstractHeuristicLabTest.cs	(revision 3970)
@@ -18,4 +18,5 @@
     /// </summary>
     public AbstractHeuristicLabTest() {
+      Persistence.DatabaseUtil.ProductionDatabase = false;
       db = Persistence.DatabaseUtil.createDataClassesDataContext();
     }
