Index: /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/User.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/User.cs	(revision 4725)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/User.cs	(revision 4726)
@@ -11,6 +11,12 @@
     {
 
+        public User()
+        {
+            Membership = new Membership();
+        }
+
         [DataMember]
         public Membership Membership { get; set; }
+
         [DataMember]
         public string Email
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/HeuristicLab.Services.Authentication.TestClient.csproj
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/HeuristicLab.Services.Authentication.TestClient.csproj	(revision 4725)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/HeuristicLab.Services.Authentication.TestClient.csproj	(revision 4726)
@@ -75,4 +75,5 @@
   </ItemGroup>
   <ItemGroup>
+    <None Include="Properties\DataSources\HeuristicLab.Services.Authentication.DataTransfer.Application.datasource" />
     <None Include="Properties\DataSources\HeuristicLab.Services.Authentication.DataTransfer.Role.datasource" />
     <None Include="Properties\DataSources\HeuristicLab.Services.Authentication.DataTransfer.User.datasource" />
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/TestClient.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/TestClient.cs	(revision 4725)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/TestClient.cs	(revision 4726)
@@ -20,214 +20,214 @@
             {
 
-                Console.WriteLine("Insert new application");
-                Application app1 = new Application() { ApplicationName="SPR Application", Description="SPR Application"};
-                app1 = auth.InsertApplication(app1);
-
-                if (app1 != null)
-                {
-                    Console.WriteLine("okay");
-                }
-                else
-                {
-                    Console.WriteLine("error");
-                }
-                Console.WriteLine("--------------------------");
-
-                Console.WriteLine("Insert user SPRTEST");
-                Membership membership = new Membership() { Email="aaa@bbb.com", Password="aaa", PasswordAnswer="bar", PasswordQuestion="foo?", PasswordSalt="aaa"};
-                User user1 = new User(){ UserName="SPRTEST", IsAnonymous=false, LastActivityDate=DateTime.Now, ApplicationId=app1.ApplicationId, Membership=membership};
-                auth.InsertUser(user1);
-                Console.WriteLine("--------------------------");
-
-                Console.WriteLine("Get user SPRTEST");
-                User user2 = auth.GetUser(app1.ApplicationId, "SPRTEST");
-                if (user2 != null)
-                {
-                    Console.WriteLine("id=" + user2.UserId);
-                }
-                else
-                {
-                    Console.WriteLine("not found!");
-                }
-                Console.WriteLine("--------------------------");
-
-
-                Console.WriteLine("Get user Einstein");
-                User user3 = auth.GetUser(app1.ApplicationId, "Einstein");
-                if (user3 != null)
-                {
-                    Console.WriteLine("id=" + user2.UserId);
-                }
-                else
-                {
-                    Console.WriteLine("not found!");
-                }
-                Console.WriteLine("--------------------------");
-
-
-                Console.WriteLine("Insert role Role1");
-                Role role1 = new Role() { RoleName = "Role1", Description = "first test role", ApplicationId = app1.ApplicationId };
-
-                if (auth.InsertRole(role1))
-                {
-                    Console.WriteLine("okay");
-                }
-                else
-                {
-                    Console.WriteLine("error");
-                }
-                Console.WriteLine("--------------------------");
-
-                Console.WriteLine("Get Role Role1");
-                Role role2 = auth.GetRole(app1.ApplicationId, "Role1");
-                if (role2 != null)
-                {
-                    Console.WriteLine("id=" + role2.RoleId);
-                }
-                else
-                {
-                    Console.WriteLine("not found!");
-                }
-                Console.WriteLine("--------------------------");
-                Console.WriteLine("Get Role Role2");
-                Role role3 = auth.GetRole(app1.ApplicationId, "Role2");
-                if (role3 != null)
-                {
-                    Console.WriteLine("id=" + role3.RoleId);
-                }
-                else
-                {
-                    Console.WriteLine("not found!");
-                }
-                Console.WriteLine("--------------------------");
+                //Console.WriteLine("Insert new application");
+                //Application app1 = new Application() { ApplicationName="SPR Application", Description="SPR Application"};
+                //app1 = auth.InsertApplication(app1);
+
+                //if (app1 != null)
+                //{
+                //    Console.WriteLine("okay");
+                //}
+                //else
+                //{
+                //    Console.WriteLine("error");
+                //}
+                //Console.WriteLine("--------------------------");
+
+                //Console.WriteLine("Insert user SPRTEST");
+                //Membership membership = new Membership() { Email="aaa@bbb.com", Password="aaa", PasswordAnswer="bar", PasswordQuestion="foo?", PasswordSalt="aaa"};
+                //User user1 = new User(){ UserName="SPRTEST", IsAnonymous=false, LastActivityDate=DateTime.Now, ApplicationId=app1.ApplicationId, Membership=membership};
+                //auth.InsertUser(user1);
+                //Console.WriteLine("--------------------------");
+
+                //Console.WriteLine("Get user SPRTEST");
+                //User user2 = auth.GetUser(app1.ApplicationId, "SPRTEST");
+                //if (user2 != null)
+                //{
+                //    Console.WriteLine("id=" + user2.UserId);
+                //}
+                //else
+                //{
+                //    Console.WriteLine("not found!");
+                //}
+                //Console.WriteLine("--------------------------");
+
+
+                //Console.WriteLine("Get user Einstein");
+                //User user3 = auth.GetUser(app1.ApplicationId, "Einstein");
+                //if (user3 != null)
+                //{
+                //    Console.WriteLine("id=" + user2.UserId);
+                //}
+                //else
+                //{
+                //    Console.WriteLine("not found!");
+                //}
+                //Console.WriteLine("--------------------------");
+
+
+                //Console.WriteLine("Insert role Role1");
+                //Role role1 = new Role() { RoleName = "Role1", Description = "first test role", ApplicationId = app1.ApplicationId };
+
+                //if (auth.InsertRole(role1))
+                //{
+                //    Console.WriteLine("okay");
+                //}
+                //else
+                //{
+                //    Console.WriteLine("error");
+                //}
+                //Console.WriteLine("--------------------------");
+
+                //Console.WriteLine("Get Role Role1");
+                //Role role2 = auth.GetRole(app1.ApplicationId, "Role1");
+                //if (role2 != null)
+                //{
+                //    Console.WriteLine("id=" + role2.RoleId);
+                //}
+                //else
+                //{
+                //    Console.WriteLine("not found!");
+                //}
+                //Console.WriteLine("--------------------------");
+                //Console.WriteLine("Get Role Role2");
+                //Role role3 = auth.GetRole(app1.ApplicationId, "Role2");
+                //if (role3 != null)
+                //{
+                //    Console.WriteLine("id=" + role3.RoleId);
+                //}
+                //else
+                //{
+                //    Console.WriteLine("not found!");
+                //}
+                //Console.WriteLine("--------------------------");
 
                 
-                Console.WriteLine("GetRoles");
-                IEnumerable<Role> list3 = auth.GetRoles(app1.ApplicationId);
-
-                foreach (Role role in list3)
-                {
-                    Console.WriteLine(role.RoleName);
-                }
-                Console.WriteLine("--------------------------");
-                Console.WriteLine("Is User SPRTEST In Role1");
-                if (auth.IsUserInRole(role2.RoleId, user2.UserId))
-                {
-                    Console.WriteLine("true");
-                }
-                else
-                {
-                    Console.WriteLine("false");
-                }
-                Console.WriteLine("--------------------------");
-
-
-
-                Console.WriteLine("Add User SPRTEST To Role1");
-                if (auth.AddUserToRole(role2.RoleId, user2.UserId))
-                {
-                    Console.WriteLine("okay");
-                }
-                else
-                {
-                    Console.WriteLine("error");
-                }
-                Console.WriteLine("--------------------------");
-
-                Console.WriteLine("Is User SPRTEST In Role1");
-                if (auth.IsUserInRole(role2.RoleId, user2.UserId))
-                {
-                    Console.WriteLine("true");
-                }
-                else
-                {
-                    Console.WriteLine("false");
-                }
-                Console.WriteLine("--------------------------");
-
-                Console.WriteLine("Add User SPRTEST To Role2");
-                if (role3 != null && auth.AddUserToRole(role3.RoleId, user2.UserId))
-                {
-                    Console.WriteLine("okay");
-                }
-                else
-                {
-                    Console.WriteLine("error");
-                }
-                Console.WriteLine("--------------------------");
+                //Console.WriteLine("GetRoles");
+                //IEnumerable<Role> list3 = auth.GetRoles(app1.ApplicationId);
+
+                //foreach (Role role in list3)
+                //{
+                //    Console.WriteLine(role.RoleName);
+                //}
+                //Console.WriteLine("--------------------------");
+                //Console.WriteLine("Is User SPRTEST In Role1");
+                //if (auth.IsUserInRole(role2.RoleId, user2.UserId))
+                //{
+                //    Console.WriteLine("true");
+                //}
+                //else
+                //{
+                //    Console.WriteLine("false");
+                //}
+                //Console.WriteLine("--------------------------");
+
+
+
+                //Console.WriteLine("Add User SPRTEST To Role1");
+                //if (auth.AddUserToRole(role2.RoleId, user2.UserId))
+                //{
+                //    Console.WriteLine("okay");
+                //}
+                //else
+                //{
+                //    Console.WriteLine("error");
+                //}
+                //Console.WriteLine("--------------------------");
+
+                //Console.WriteLine("Is User SPRTEST In Role1");
+                //if (auth.IsUserInRole(role2.RoleId, user2.UserId))
+                //{
+                //    Console.WriteLine("true");
+                //}
+                //else
+                //{
+                //    Console.WriteLine("false");
+                //}
+                //Console.WriteLine("--------------------------");
+
+                //Console.WriteLine("Add User SPRTEST To Role2");
+                //if (role3 != null && auth.AddUserToRole(role3.RoleId, user2.UserId))
+                //{
+                //    Console.WriteLine("okay");
+                //}
+                //else
+                //{
+                //    Console.WriteLine("error");
+                //}
+                //Console.WriteLine("--------------------------");
  
 
                 
-                IEnumerable<User> list1 = auth.GetUsers(app1.ApplicationId);
-                Console.WriteLine("Get Users");
-                foreach (var item in list1)
-                {
-                    Console.WriteLine( item.UserName);
-                }
-
-                Console.WriteLine("--------------------------");
-                User user4 = auth.GetUser(app1.ApplicationId, "SPRTEST");
-                if (user4 != null)
-                {
-                    IEnumerable<Role> roles = auth.GetRolesForUser(user4.UserId);
-                    Console.WriteLine("Get Roles for user SPRTEST");
-                    foreach (Role r in roles)
-                    {
-                        Console.WriteLine(r.RoleName);
-                    }
-                }
-                
-                Console.WriteLine("--------------------------");
-                Console.WriteLine("Remove SPRTEST From Role1");
-                if (auth.RemoveUserFromRole(role2.RoleId, user4.UserId))
-                {
-                    Console.WriteLine("okay");
-                }
-                else
-                {
-                    Console.WriteLine("error");
-                }
-
-                Console.WriteLine("--------------------------");
-                User user5 = auth.GetUser(app1.ApplicationId, "SPRTEST");
-                if (user5 != null)
-                {
-                    IEnumerable<Role> roles = auth.GetRolesForUser(user5.UserId);
-                    Console.WriteLine("Get Roles for user SPRTEST");
-                    foreach (Role r in roles)
-                    {
-                        Console.WriteLine(r.RoleName);
-                    }
-                }
-
-                Console.WriteLine("--------------------------");
-                Console.WriteLine("Delete User SPRTEST");
-                if (auth.DeleteUser(user4.UserId))
-                {
-                    Console.WriteLine("okay");
-                }
-                else
-                {
-                    Console.WriteLine("error");
-                }
-                Console.WriteLine("--------------------------");
-
-                IEnumerable<User> list2 = auth.GetUsers(app1.ApplicationId);
-                Console.WriteLine("Get Users");
-                foreach (var item in list2)
-                {
-                    Console.WriteLine(item.UserName);
-                }
-
-                Console.WriteLine("--------------------------");
-                Console.WriteLine("Update user SPRTEST");
-                User user6 = auth.GetUser(app1.ApplicationId,"SPRTEST");
-
-                if (user6 != null)
-                {
-                    user6.LoweredUserName = "new lowered name";
-                    user6.Membership.Email = "new email";
-                    auth.UpdateUser(user6);
-                }
+                //IEnumerable<User> list1 = auth.GetUsers(app1.ApplicationId);
+                //Console.WriteLine("Get Users");
+                //foreach (var item in list1)
+                //{
+                //    Console.WriteLine( item.UserName);
+                //}
+
+                //Console.WriteLine("--------------------------");
+                //User user4 = auth.GetUser(app1.ApplicationId, "SPRTEST");
+                //if (user4 != null)
+                //{
+                //    IEnumerable<Role> roles = auth.GetRolesForUser(user4.UserId);
+                //    Console.WriteLine("Get Roles for user SPRTEST");
+                //    foreach (Role r in roles)
+                //    {
+                //        Console.WriteLine(r.RoleName);
+                //    }
+                //}
+                ///*
+                //Console.WriteLine("--------------------------");
+                //Console.WriteLine("Remove SPRTEST From Role1");
+                //if (auth.RemoveUserFromRole(role2.RoleId, user4.UserId))
+                //{
+                //    Console.WriteLine("okay");
+                //}
+                //else
+                //{
+                //    Console.WriteLine("error");
+                //}
+                //*/
+                //Console.WriteLine("--------------------------");
+                //User user5 = auth.GetUser(app1.ApplicationId, "SPRTEST");
+                //if (user5 != null)
+                //{
+                //    IEnumerable<Role> roles = auth.GetRolesForUser(user5.UserId);
+                //    Console.WriteLine("Get Roles for user SPRTEST");
+                //    foreach (Role r in roles)
+                //    {
+                //        Console.WriteLine(r.RoleName);
+                //    }
+                //}
+                ///*
+                //Console.WriteLine("--------------------------");
+                //Console.WriteLine("Delete User SPRTEST");
+                //if (auth.DeleteUser(user4.UserId))
+                //{
+                //    Console.WriteLine("okay");
+                //}
+                //else
+                //{
+                //    Console.WriteLine("error");
+                //}
+                //Console.WriteLine("--------------------------");
+                //*/
+                //IEnumerable<User> list2 = auth.GetUsers(app1.ApplicationId);
+                //Console.WriteLine("Get Users");
+                //foreach (var item in list2)
+                //{
+                //    Console.WriteLine(item.UserName);
+                //}
+
+                //Console.WriteLine("--------------------------");
+                //Console.WriteLine("Update user SPRTEST");
+                //User user6 = auth.GetUser(app1.ApplicationId,"SPRTEST");
+
+                //if (user6 != null)
+                //{
+                //    user6.LoweredUserName = "new lowered name";
+                //    user6.Membership.Email = "new email";
+                //    auth.UpdateUser(user6);
+                //}
 
 
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.Designer.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.Designer.cs	(revision 4725)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.Designer.cs	(revision 4726)
@@ -30,84 +30,154 @@
         {
             this.components = new System.ComponentModel.Container();
-            System.Windows.Forms.Label isAnonymousLabel;
+            System.Windows.Forms.Label roleNameLabel;
+            System.Windows.Forms.Label descriptionLabel;
+            System.Windows.Forms.Label emailLabel;
+            System.Windows.Forms.Label userNameLabel;
             System.Windows.Forms.Label passwordLabel;
-            System.Windows.Forms.Label passwordAnswerLabel;
             System.Windows.Forms.Label passwordQuestionLabel;
             System.Windows.Forms.Label passwordSaltLabel;
-            System.Windows.Forms.Label emailLabel;
-            System.Windows.Forms.Label roleNameLabel;
-            this.bsUsers = new System.Windows.Forms.BindingSource(this.components);
-            this.bsRoles = new System.Windows.Forms.BindingSource(this.components);
             this.scMain = new System.Windows.Forms.SplitContainer();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.cbxApplication = new System.Windows.Forms.ComboBox();
+            this.bsApplications = new System.Windows.Forms.BindingSource(this.components);
+            this.label1 = new System.Windows.Forms.Label();
             this.tabControl1 = new System.Windows.Forms.TabControl();
             this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.btnDeleteUser = new System.Windows.Forms.Button();
+            this.btnNewUser = new System.Windows.Forms.Button();
+            this.dgvUsers = new System.Windows.Forms.DataGridView();
+            this.bsUsers = new System.Windows.Forms.BindingSource(this.components);
+            this.tcUser = new System.Windows.Forms.TabControl();
+            this.tabPage3 = new System.Windows.Forms.TabPage();
+            this.passwordSaltTextBox = new System.Windows.Forms.TextBox();
+            this.bsUser = new System.Windows.Forms.BindingSource(this.components);
+            this.passwordQuestionTextBox = new System.Windows.Forms.TextBox();
+            this.passwordTextBox = new System.Windows.Forms.TextBox();
+            this.userNameTextBox = new System.Windows.Forms.TextBox();
+            this.emailTextBox = new System.Windows.Forms.TextBox();
+            this.btnSaveUser = new System.Windows.Forms.Button();
             this.tabPage2 = new System.Windows.Forms.TabPage();
-            this.tabControl2 = new System.Windows.Forms.TabControl();
-            this.tabPage4 = new System.Windows.Forms.TabPage();
-            this.tabControl3 = new System.Windows.Forms.TabControl();
-            this.tabPage5 = new System.Windows.Forms.TabPage();
-            this.tabPage6 = new System.Windows.Forms.TabPage();
-            this.dgvUsers = new System.Windows.Forms.DataGridView();
+            this.btnDeleteRole = new System.Windows.Forms.Button();
+            this.btnNewRole = new System.Windows.Forms.Button();
             this.dgvRoles = new System.Windows.Forms.DataGridView();
-            this.panel1 = new System.Windows.Forms.Panel();
-            this.label1 = new System.Windows.Forms.Label();
-            this.membershipDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.applicationIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.userIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.userNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.loweredUserNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mobileAliasDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.isAnonymousDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lastActivityDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.tabPage3 = new System.Windows.Forms.TabPage();
-            this.isAnonymousCheckBox = new System.Windows.Forms.CheckBox();
-            this.passwordTextBox = new System.Windows.Forms.TextBox();
-            this.passwordAnswerTextBox = new System.Windows.Forms.TextBox();
-            this.passwordQuestionTextBox = new System.Windows.Forms.TextBox();
-            this.passwordSaltTextBox = new System.Windows.Forms.TextBox();
-            this.emailTextBox = new System.Windows.Forms.TextBox();
-            this.dataGridView1 = new System.Windows.Forms.DataGridView();
-            this.roleNameTextBox = new System.Windows.Forms.TextBox();
-            this.dataGridView2 = new System.Windows.Forms.DataGridView();
-            this.roleIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.roleNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.loweredRoleNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.descriptionDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            isAnonymousLabel = new System.Windows.Forms.Label();
+            this.bsRoles = new System.Windows.Forms.BindingSource(this.components);
+            this.tcRole = new System.Windows.Forms.TabControl();
+            this.tpRoleDetail = new System.Windows.Forms.TabPage();
+            this.descriptionTextBox = new System.Windows.Forms.TextBox();
+            this.bsRole = new System.Windows.Forms.BindingSource(this.components);
+            this.btnSaveRole = new System.Windows.Forms.Button();
+            this.roleNameTextBox = new System.Windows.Forms.TextBox();
+            this.tabPage6 = new System.Windows.Forms.TabPage();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.dgvRoleAssignedUsers = new System.Windows.Forms.DataGridView();
+            this.userNameDataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bsRoleUsers = new System.Windows.Forms.BindingSource(this.components);
+            this.btnAddUserToRole = new System.Windows.Forms.Button();
+            this.btnRemoveUserFromRole = new System.Windows.Forms.Button();
+            this.dgvRoleAvailableUsers = new System.Windows.Forms.DataGridView();
+            this.userNameDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bsUserRoles = new System.Windows.Forms.BindingSource(this.components);
+            this.Membership = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.isAnonymousDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.userNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            roleNameLabel = new System.Windows.Forms.Label();
+            descriptionLabel = new System.Windows.Forms.Label();
+            emailLabel = new System.Windows.Forms.Label();
+            userNameLabel = new System.Windows.Forms.Label();
             passwordLabel = new System.Windows.Forms.Label();
-            passwordAnswerLabel = new System.Windows.Forms.Label();
             passwordQuestionLabel = new System.Windows.Forms.Label();
             passwordSaltLabel = new System.Windows.Forms.Label();
-            emailLabel = new System.Windows.Forms.Label();
-            roleNameLabel = new System.Windows.Forms.Label();
-            ((System.ComponentModel.ISupportInitialize)(this.bsUsers)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.bsRoles)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
             this.scMain.Panel1.SuspendLayout();
             this.scMain.Panel2.SuspendLayout();
             this.scMain.SuspendLayout();
+            this.panel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bsApplications)).BeginInit();
             this.tabControl1.SuspendLayout();
             this.tabPage1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dgvUsers)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsUsers)).BeginInit();
+            this.tcUser.SuspendLayout();
+            this.tabPage3.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bsUser)).BeginInit();
             this.tabPage2.SuspendLayout();
-            this.tabControl2.SuspendLayout();
-            this.tabPage4.SuspendLayout();
-            this.tabControl3.SuspendLayout();
-            this.tabPage5.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dgvRoles)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsRoles)).BeginInit();
+            this.tcRole.SuspendLayout();
+            this.tpRoleDetail.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bsRole)).BeginInit();
             this.tabPage6.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dgvUsers)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.dgvRoles)).BeginInit();
-            this.panel1.SuspendLayout();
-            this.tabPage3.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dgvRoleAssignedUsers)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsRoleUsers)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dgvRoleAvailableUsers)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsUserRoles)).BeginInit();
             this.SuspendLayout();
             // 
-            // bsUsers
-            // 
-            this.bsUsers.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.User);
-            // 
-            // bsRoles
-            // 
-            this.bsRoles.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.Role);
+            // roleNameLabel
+            // 
+            roleNameLabel.AutoSize = true;
+            roleNameLabel.Location = new System.Drawing.Point(12, 22);
+            roleNameLabel.Name = "roleNameLabel";
+            roleNameLabel.Size = new System.Drawing.Size(63, 13);
+            roleNameLabel.TabIndex = 0;
+            roleNameLabel.Text = "Role Name:";
+            // 
+            // descriptionLabel
+            // 
+            descriptionLabel.AutoSize = true;
+            descriptionLabel.Location = new System.Drawing.Point(13, 57);
+            descriptionLabel.Name = "descriptionLabel";
+            descriptionLabel.Size = new System.Drawing.Size(63, 13);
+            descriptionLabel.TabIndex = 3;
+            descriptionLabel.Text = "Description:";
+            // 
+            // emailLabel
+            // 
+            emailLabel.AutoSize = true;
+            emailLabel.Location = new System.Drawing.Point(25, 102);
+            emailLabel.Name = "emailLabel";
+            emailLabel.Size = new System.Drawing.Size(35, 13);
+            emailLabel.TabIndex = 12;
+            emailLabel.Text = "Email:";
+            // 
+            // userNameLabel
+            // 
+            userNameLabel.AutoSize = true;
+            userNameLabel.Location = new System.Drawing.Point(25, 24);
+            userNameLabel.Name = "userNameLabel";
+            userNameLabel.Size = new System.Drawing.Size(63, 13);
+            userNameLabel.TabIndex = 13;
+            userNameLabel.Text = "User Name:";
+            // 
+            // passwordLabel
+            // 
+            passwordLabel.AutoSize = true;
+            passwordLabel.Location = new System.Drawing.Point(25, 47);
+            passwordLabel.Name = "passwordLabel";
+            passwordLabel.Size = new System.Drawing.Size(56, 13);
+            passwordLabel.TabIndex = 14;
+            passwordLabel.Text = "Password:";
+            // 
+            // passwordQuestionLabel
+            // 
+            passwordQuestionLabel.AutoSize = true;
+            passwordQuestionLabel.Location = new System.Drawing.Point(25, 76);
+            passwordQuestionLabel.Name = "passwordQuestionLabel";
+            passwordQuestionLabel.Size = new System.Drawing.Size(101, 13);
+            passwordQuestionLabel.TabIndex = 15;
+            passwordQuestionLabel.Text = "Password Question:";
+            // 
+            // passwordSaltLabel
+            // 
+            passwordSaltLabel.AutoSize = true;
+            passwordSaltLabel.Location = new System.Drawing.Point(25, 130);
+            passwordSaltLabel.Name = "passwordSaltLabel";
+            passwordSaltLabel.Size = new System.Drawing.Size(77, 13);
+            passwordSaltLabel.TabIndex = 16;
+            passwordSaltLabel.Text = "Password Salt:";
             // 
             // scMain
@@ -125,7 +195,43 @@
             // 
             this.scMain.Panel2.Controls.Add(this.tabControl1);
-            this.scMain.Size = new System.Drawing.Size(1100, 556);
-            this.scMain.SplitterDistance = 47;
+            this.scMain.Size = new System.Drawing.Size(1100, 610);
+            this.scMain.SplitterDistance = 51;
             this.scMain.TabIndex = 9;
+            // 
+            // panel1
+            // 
+            this.panel1.Controls.Add(this.cbxApplication);
+            this.panel1.Controls.Add(this.label1);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(1100, 51);
+            this.panel1.TabIndex = 0;
+            // 
+            // cbxApplication
+            // 
+            this.cbxApplication.DataSource = this.bsApplications;
+            this.cbxApplication.DisplayMember = "ApplicationName";
+            this.cbxApplication.FormattingEnabled = true;
+            this.cbxApplication.Location = new System.Drawing.Point(910, 18);
+            this.cbxApplication.Name = "cbxApplication";
+            this.cbxApplication.Size = new System.Drawing.Size(178, 21);
+            this.cbxApplication.TabIndex = 1;
+            this.cbxApplication.SelectedIndexChanged += new System.EventHandler(this.cbxApplication_SelectedIndexChanged);
+            // 
+            // bsApplications
+            // 
+            this.bsApplications.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.Application);
+            // 
+            // label1
+            // 
+            this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label1.Location = new System.Drawing.Point(0, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(1100, 51);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "Heuristic Lab User Management";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
             // 
             // tabControl1
@@ -137,5 +243,5 @@
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
-            this.tabControl1.Size = new System.Drawing.Size(1100, 505);
+            this.tabControl1.Size = new System.Drawing.Size(1100, 555);
             this.tabControl1.TabIndex = 0;
             // 
@@ -143,75 +249,291 @@
             // 
             this.tabPage1.AutoScroll = true;
+            this.tabPage1.Controls.Add(this.btnDeleteUser);
+            this.tabPage1.Controls.Add(this.btnNewUser);
             this.tabPage1.Controls.Add(this.dgvUsers);
-            this.tabPage1.Controls.Add(this.tabControl2);
+            this.tabPage1.Controls.Add(this.tcUser);
             this.tabPage1.Location = new System.Drawing.Point(4, 22);
             this.tabPage1.Name = "tabPage1";
             this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage1.Size = new System.Drawing.Size(1092, 479);
+            this.tabPage1.Size = new System.Drawing.Size(1092, 529);
             this.tabPage1.TabIndex = 0;
             this.tabPage1.Text = "User";
             this.tabPage1.UseVisualStyleBackColor = true;
             // 
+            // btnDeleteUser
+            // 
+            this.btnDeleteUser.Location = new System.Drawing.Point(89, 16);
+            this.btnDeleteUser.Name = "btnDeleteUser";
+            this.btnDeleteUser.Size = new System.Drawing.Size(75, 23);
+            this.btnDeleteUser.TabIndex = 3;
+            this.btnDeleteUser.Text = "delete user";
+            this.btnDeleteUser.UseVisualStyleBackColor = true;
+            this.btnDeleteUser.Click += new System.EventHandler(this.btnDeleteUser_Click);
+            // 
+            // btnNewUser
+            // 
+            this.btnNewUser.Location = new System.Drawing.Point(8, 16);
+            this.btnNewUser.Name = "btnNewUser";
+            this.btnNewUser.Size = new System.Drawing.Size(75, 23);
+            this.btnNewUser.TabIndex = 2;
+            this.btnNewUser.Text = "new User";
+            this.btnNewUser.UseVisualStyleBackColor = true;
+            this.btnNewUser.Click += new System.EventHandler(this.btnNewUser_Click);
+            // 
+            // dgvUsers
+            // 
+            this.dgvUsers.AllowUserToAddRows = false;
+            this.dgvUsers.AllowUserToDeleteRows = false;
+            this.dgvUsers.AutoGenerateColumns = false;
+            this.dgvUsers.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dgvUsers.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.userNameDataGridViewTextBoxColumn,
+            this.isAnonymousDataGridViewCheckBoxColumn,
+            this.Membership});
+            this.dgvUsers.DataSource = this.bsUsers;
+            this.dgvUsers.Location = new System.Drawing.Point(3, 45);
+            this.dgvUsers.Name = "dgvUsers";
+            this.dgvUsers.Size = new System.Drawing.Size(1086, 290);
+            this.dgvUsers.TabIndex = 1;
+            this.dgvUsers.SelectionChanged += new System.EventHandler(this.dgvUsers_SelectionChanged);
+            // 
+            // bsUsers
+            // 
+            this.bsUsers.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.User);
+            // 
+            // tcUser
+            // 
+            this.tcUser.Controls.Add(this.tabPage3);
+            this.tcUser.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.tcUser.Enabled = false;
+            this.tcUser.Location = new System.Drawing.Point(3, 341);
+            this.tcUser.Name = "tcUser";
+            this.tcUser.SelectedIndex = 0;
+            this.tcUser.Size = new System.Drawing.Size(1086, 185);
+            this.tcUser.TabIndex = 0;
+            // 
+            // tabPage3
+            // 
+            this.tabPage3.AutoScroll = true;
+            this.tabPage3.Controls.Add(passwordSaltLabel);
+            this.tabPage3.Controls.Add(this.passwordSaltTextBox);
+            this.tabPage3.Controls.Add(passwordQuestionLabel);
+            this.tabPage3.Controls.Add(this.passwordQuestionTextBox);
+            this.tabPage3.Controls.Add(passwordLabel);
+            this.tabPage3.Controls.Add(this.passwordTextBox);
+            this.tabPage3.Controls.Add(userNameLabel);
+            this.tabPage3.Controls.Add(this.userNameTextBox);
+            this.tabPage3.Controls.Add(emailLabel);
+            this.tabPage3.Controls.Add(this.emailTextBox);
+            this.tabPage3.Controls.Add(this.btnSaveUser);
+            this.tabPage3.Location = new System.Drawing.Point(4, 22);
+            this.tabPage3.Name = "tabPage3";
+            this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage3.Size = new System.Drawing.Size(1078, 159);
+            this.tabPage3.TabIndex = 0;
+            this.tabPage3.Text = "Detail";
+            this.tabPage3.UseVisualStyleBackColor = true;
+            // 
+            // passwordSaltTextBox
+            // 
+            this.passwordSaltTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUser, "Membership.PasswordSalt", true));
+            this.passwordSaltTextBox.Location = new System.Drawing.Point(134, 127);
+            this.passwordSaltTextBox.Name = "passwordSaltTextBox";
+            this.passwordSaltTextBox.Size = new System.Drawing.Size(145, 20);
+            this.passwordSaltTextBox.TabIndex = 17;
+            // 
+            // bsUser
+            // 
+            this.bsUser.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.User);
+            // 
+            // passwordQuestionTextBox
+            // 
+            this.passwordQuestionTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUser, "PasswordQuestion", true));
+            this.passwordQuestionTextBox.Location = new System.Drawing.Point(134, 73);
+            this.passwordQuestionTextBox.Name = "passwordQuestionTextBox";
+            this.passwordQuestionTextBox.Size = new System.Drawing.Size(145, 20);
+            this.passwordQuestionTextBox.TabIndex = 16;
+            // 
+            // passwordTextBox
+            // 
+            this.passwordTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUser, "Password", true));
+            this.passwordTextBox.Location = new System.Drawing.Point(134, 47);
+            this.passwordTextBox.Name = "passwordTextBox";
+            this.passwordTextBox.Size = new System.Drawing.Size(145, 20);
+            this.passwordTextBox.TabIndex = 15;
+            // 
+            // userNameTextBox
+            // 
+            this.userNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUser, "UserName", true));
+            this.userNameTextBox.Location = new System.Drawing.Point(134, 21);
+            this.userNameTextBox.Name = "userNameTextBox";
+            this.userNameTextBox.Size = new System.Drawing.Size(145, 20);
+            this.userNameTextBox.TabIndex = 14;
+            // 
+            // emailTextBox
+            // 
+            this.emailTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUser, "Email", true));
+            this.emailTextBox.Location = new System.Drawing.Point(134, 99);
+            this.emailTextBox.Name = "emailTextBox";
+            this.emailTextBox.Size = new System.Drawing.Size(145, 20);
+            this.emailTextBox.TabIndex = 13;
+            // 
+            // btnSaveUser
+            // 
+            this.btnSaveUser.Location = new System.Drawing.Point(303, 19);
+            this.btnSaveUser.Name = "btnSaveUser";
+            this.btnSaveUser.Size = new System.Drawing.Size(75, 23);
+            this.btnSaveUser.TabIndex = 12;
+            this.btnSaveUser.Text = "Save";
+            this.btnSaveUser.UseVisualStyleBackColor = true;
+            this.btnSaveUser.Click += new System.EventHandler(this.btnSaveUser_Click);
+            // 
             // tabPage2
             // 
             this.tabPage2.AutoScroll = true;
+            this.tabPage2.Controls.Add(this.btnDeleteRole);
+            this.tabPage2.Controls.Add(this.btnNewRole);
             this.tabPage2.Controls.Add(this.dgvRoles);
-            this.tabPage2.Controls.Add(this.tabControl3);
+            this.tabPage2.Controls.Add(this.tcRole);
             this.tabPage2.Location = new System.Drawing.Point(4, 22);
             this.tabPage2.Name = "tabPage2";
             this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage2.Size = new System.Drawing.Size(1092, 479);
+            this.tabPage2.Size = new System.Drawing.Size(1092, 529);
             this.tabPage2.TabIndex = 1;
             this.tabPage2.Text = "Roles";
             this.tabPage2.UseVisualStyleBackColor = true;
             // 
-            // tabControl2
-            // 
-            this.tabControl2.Controls.Add(this.tabPage3);
-            this.tabControl2.Controls.Add(this.tabPage4);
-            this.tabControl2.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.tabControl2.Location = new System.Drawing.Point(3, 291);
-            this.tabControl2.Name = "tabControl2";
-            this.tabControl2.SelectedIndex = 0;
-            this.tabControl2.Size = new System.Drawing.Size(1086, 185);
-            this.tabControl2.TabIndex = 0;
-            // 
-            // tabPage4
-            // 
-            this.tabPage4.Controls.Add(this.dataGridView1);
-            this.tabPage4.Location = new System.Drawing.Point(4, 22);
-            this.tabPage4.Name = "tabPage4";
-            this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage4.Size = new System.Drawing.Size(1078, 159);
-            this.tabPage4.TabIndex = 1;
-            this.tabPage4.Text = "Roles";
-            this.tabPage4.UseVisualStyleBackColor = true;
-            // 
-            // tabControl3
-            // 
-            this.tabControl3.Controls.Add(this.tabPage5);
-            this.tabControl3.Controls.Add(this.tabPage6);
-            this.tabControl3.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.tabControl3.Location = new System.Drawing.Point(3, 291);
-            this.tabControl3.Name = "tabControl3";
-            this.tabControl3.SelectedIndex = 0;
-            this.tabControl3.Size = new System.Drawing.Size(1086, 185);
-            this.tabControl3.TabIndex = 1;
-            // 
-            // tabPage5
-            // 
-            this.tabPage5.Controls.Add(roleNameLabel);
-            this.tabPage5.Controls.Add(this.roleNameTextBox);
-            this.tabPage5.Location = new System.Drawing.Point(4, 22);
-            this.tabPage5.Name = "tabPage5";
-            this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage5.Size = new System.Drawing.Size(1078, 159);
-            this.tabPage5.TabIndex = 0;
-            this.tabPage5.Text = "Detail";
-            this.tabPage5.UseVisualStyleBackColor = true;
+            // btnDeleteRole
+            // 
+            this.btnDeleteRole.Enabled = false;
+            this.btnDeleteRole.Location = new System.Drawing.Point(89, 16);
+            this.btnDeleteRole.Name = "btnDeleteRole";
+            this.btnDeleteRole.Size = new System.Drawing.Size(75, 23);
+            this.btnDeleteRole.TabIndex = 4;
+            this.btnDeleteRole.Text = "delete Role";
+            this.btnDeleteRole.UseVisualStyleBackColor = true;
+            this.btnDeleteRole.Click += new System.EventHandler(this.btnDeleteRole_Click);
+            // 
+            // btnNewRole
+            // 
+            this.btnNewRole.Location = new System.Drawing.Point(8, 16);
+            this.btnNewRole.Name = "btnNewRole";
+            this.btnNewRole.Size = new System.Drawing.Size(75, 23);
+            this.btnNewRole.TabIndex = 3;
+            this.btnNewRole.Text = "new Role";
+            this.btnNewRole.UseVisualStyleBackColor = true;
+            this.btnNewRole.Click += new System.EventHandler(this.btnNewRole_Click);
+            // 
+            // dgvRoles
+            // 
+            this.dgvRoles.AllowUserToAddRows = false;
+            this.dgvRoles.AllowUserToDeleteRows = false;
+            this.dgvRoles.AutoGenerateColumns = false;
+            this.dgvRoles.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dgvRoles.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.roleNameDataGridViewTextBoxColumn,
+            this.loweredRoleNameDataGridViewTextBoxColumn,
+            this.descriptionDataGridViewTextBoxColumn});
+            this.dgvRoles.DataSource = this.bsRoles;
+            this.dgvRoles.Location = new System.Drawing.Point(3, 45);
+            this.dgvRoles.MultiSelect = false;
+            this.dgvRoles.Name = "dgvRoles";
+            this.dgvRoles.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+            this.dgvRoles.Size = new System.Drawing.Size(1086, 290);
+            this.dgvRoles.TabIndex = 2;
+            this.dgvRoles.SelectionChanged += new System.EventHandler(this.dgvRoles_SelectionChanged);
+            // 
+            // roleNameDataGridViewTextBoxColumn
+            // 
+            this.roleNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.roleNameDataGridViewTextBoxColumn.DataPropertyName = "RoleName";
+            this.roleNameDataGridViewTextBoxColumn.HeaderText = "Name";
+            this.roleNameDataGridViewTextBoxColumn.Name = "roleNameDataGridViewTextBoxColumn";
+            // 
+            // loweredRoleNameDataGridViewTextBoxColumn
+            // 
+            this.loweredRoleNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
+            this.loweredRoleNameDataGridViewTextBoxColumn.DataPropertyName = "LoweredRoleName";
+            this.loweredRoleNameDataGridViewTextBoxColumn.HeaderText = "Lowered Name";
+            this.loweredRoleNameDataGridViewTextBoxColumn.Name = "loweredRoleNameDataGridViewTextBoxColumn";
+            this.loweredRoleNameDataGridViewTextBoxColumn.Width = 96;
+            // 
+            // descriptionDataGridViewTextBoxColumn
+            // 
+            this.descriptionDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
+            this.descriptionDataGridViewTextBoxColumn.DataPropertyName = "Description";
+            this.descriptionDataGridViewTextBoxColumn.HeaderText = "Description";
+            this.descriptionDataGridViewTextBoxColumn.Name = "descriptionDataGridViewTextBoxColumn";
+            this.descriptionDataGridViewTextBoxColumn.Width = 85;
+            // 
+            // bsRoles
+            // 
+            this.bsRoles.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.Role);
+            // 
+            // tcRole
+            // 
+            this.tcRole.Controls.Add(this.tpRoleDetail);
+            this.tcRole.Controls.Add(this.tabPage6);
+            this.tcRole.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.tcRole.Enabled = false;
+            this.tcRole.Location = new System.Drawing.Point(3, 341);
+            this.tcRole.Name = "tcRole";
+            this.tcRole.SelectedIndex = 0;
+            this.tcRole.Size = new System.Drawing.Size(1086, 185);
+            this.tcRole.TabIndex = 1;
+            // 
+            // tpRoleDetail
+            // 
+            this.tpRoleDetail.Controls.Add(descriptionLabel);
+            this.tpRoleDetail.Controls.Add(this.descriptionTextBox);
+            this.tpRoleDetail.Controls.Add(this.btnSaveRole);
+            this.tpRoleDetail.Controls.Add(roleNameLabel);
+            this.tpRoleDetail.Controls.Add(this.roleNameTextBox);
+            this.tpRoleDetail.Location = new System.Drawing.Point(4, 22);
+            this.tpRoleDetail.Name = "tpRoleDetail";
+            this.tpRoleDetail.Padding = new System.Windows.Forms.Padding(3);
+            this.tpRoleDetail.Size = new System.Drawing.Size(1078, 159);
+            this.tpRoleDetail.TabIndex = 0;
+            this.tpRoleDetail.Text = "Detail";
+            this.tpRoleDetail.UseVisualStyleBackColor = true;
+            // 
+            // descriptionTextBox
+            // 
+            this.descriptionTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsRole, "Description", true));
+            this.descriptionTextBox.Location = new System.Drawing.Point(81, 54);
+            this.descriptionTextBox.Name = "descriptionTextBox";
+            this.descriptionTextBox.Size = new System.Drawing.Size(191, 20);
+            this.descriptionTextBox.TabIndex = 4;
+            // 
+            // bsRole
+            // 
+            this.bsRole.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.Role);
+            // 
+            // btnSaveRole
+            // 
+            this.btnSaveRole.Location = new System.Drawing.Point(197, 80);
+            this.btnSaveRole.Name = "btnSaveRole";
+            this.btnSaveRole.Size = new System.Drawing.Size(75, 23);
+            this.btnSaveRole.TabIndex = 2;
+            this.btnSaveRole.Text = "Save Role";
+            this.btnSaveRole.UseVisualStyleBackColor = true;
+            this.btnSaveRole.Click += new System.EventHandler(this.btnSaveRole_Click);
+            // 
+            // roleNameTextBox
+            // 
+            this.roleNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsRole, "RoleName", true));
+            this.roleNameTextBox.Location = new System.Drawing.Point(81, 19);
+            this.roleNameTextBox.Name = "roleNameTextBox";
+            this.roleNameTextBox.Size = new System.Drawing.Size(191, 20);
+            this.roleNameTextBox.TabIndex = 1;
             // 
             // tabPage6
             // 
-            this.tabPage6.Controls.Add(this.dataGridView2);
+            this.tabPage6.Controls.Add(this.label3);
+            this.tabPage6.Controls.Add(this.label2);
+            this.tabPage6.Controls.Add(this.dgvRoleAssignedUsers);
+            this.tabPage6.Controls.Add(this.btnAddUserToRole);
+            this.tabPage6.Controls.Add(this.btnRemoveUserFromRole);
+            this.tabPage6.Controls.Add(this.dgvRoleAvailableUsers);
             this.tabPage6.Location = new System.Drawing.Point(4, 22);
             this.tabPage6.Name = "tabPage6";
@@ -222,335 +544,149 @@
             this.tabPage6.UseVisualStyleBackColor = true;
             // 
-            // dgvUsers
-            // 
-            this.dgvUsers.AutoGenerateColumns = false;
-            this.dgvUsers.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dgvUsers.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.membershipDataGridViewTextBoxColumn,
-            this.applicationIdDataGridViewTextBoxColumn,
-            this.userIdDataGridViewTextBoxColumn,
-            this.userNameDataGridViewTextBoxColumn,
-            this.loweredUserNameDataGridViewTextBoxColumn,
-            this.mobileAliasDataGridViewTextBoxColumn,
-            this.isAnonymousDataGridViewCheckBoxColumn,
-            this.lastActivityDateDataGridViewTextBoxColumn});
-            this.dgvUsers.DataSource = this.bsUsers;
-            this.dgvUsers.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.dgvUsers.Location = new System.Drawing.Point(3, 3);
-            this.dgvUsers.Name = "dgvUsers";
-            this.dgvUsers.Size = new System.Drawing.Size(1086, 288);
-            this.dgvUsers.TabIndex = 1;
-            // 
-            // dgvRoles
-            // 
-            this.dgvRoles.AllowUserToAddRows = false;
-            this.dgvRoles.AllowUserToDeleteRows = false;
-            this.dgvRoles.AutoGenerateColumns = false;
-            this.dgvRoles.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dgvRoles.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.roleIdDataGridViewTextBoxColumn,
-            this.roleNameDataGridViewTextBoxColumn,
-            this.loweredRoleNameDataGridViewTextBoxColumn,
-            this.descriptionDataGridViewTextBoxColumn});
-            this.dgvRoles.DataSource = this.bsRoles;
-            this.dgvRoles.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.dgvRoles.Location = new System.Drawing.Point(3, 3);
-            this.dgvRoles.MultiSelect = false;
-            this.dgvRoles.Name = "dgvRoles";
-            this.dgvRoles.Size = new System.Drawing.Size(1086, 288);
-            this.dgvRoles.TabIndex = 2;
-            // 
-            // panel1
-            // 
-            this.panel1.Controls.Add(this.label1);
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.panel1.Location = new System.Drawing.Point(0, 0);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(1100, 47);
-            this.panel1.TabIndex = 0;
-            // 
-            // label1
-            // 
-            this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.label1.Location = new System.Drawing.Point(0, 0);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(1100, 47);
-            this.label1.TabIndex = 0;
-            this.label1.Text = "Heuristic Lab User Management";
-            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
-            // 
-            // membershipDataGridViewTextBoxColumn
-            // 
-            this.membershipDataGridViewTextBoxColumn.DataPropertyName = "Membership";
-            this.membershipDataGridViewTextBoxColumn.HeaderText = "Membership";
-            this.membershipDataGridViewTextBoxColumn.Name = "membershipDataGridViewTextBoxColumn";
-            // 
-            // applicationIdDataGridViewTextBoxColumn
-            // 
-            this.applicationIdDataGridViewTextBoxColumn.DataPropertyName = "ApplicationId";
-            this.applicationIdDataGridViewTextBoxColumn.HeaderText = "ApplicationId";
-            this.applicationIdDataGridViewTextBoxColumn.Name = "applicationIdDataGridViewTextBoxColumn";
-            // 
-            // userIdDataGridViewTextBoxColumn
-            // 
-            this.userIdDataGridViewTextBoxColumn.DataPropertyName = "UserId";
-            this.userIdDataGridViewTextBoxColumn.HeaderText = "UserId";
-            this.userIdDataGridViewTextBoxColumn.Name = "userIdDataGridViewTextBoxColumn";
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(501, 18);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(79, 13);
+            this.label3.TabIndex = 6;
+            this.label3.Text = "available Users";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(6, 18);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(79, 13);
+            this.label2.TabIndex = 5;
+            this.label2.Text = "assigned Users";
+            // 
+            // dgvRoleAssignedUsers
+            // 
+            this.dgvRoleAssignedUsers.AllowUserToAddRows = false;
+            this.dgvRoleAssignedUsers.AllowUserToDeleteRows = false;
+            this.dgvRoleAssignedUsers.AutoGenerateColumns = false;
+            this.dgvRoleAssignedUsers.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dgvRoleAssignedUsers.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.userNameDataGridViewTextBoxColumn2});
+            this.dgvRoleAssignedUsers.DataSource = this.bsRoleUsers;
+            this.dgvRoleAssignedUsers.Location = new System.Drawing.Point(6, 34);
+            this.dgvRoleAssignedUsers.Name = "dgvRoleAssignedUsers";
+            this.dgvRoleAssignedUsers.Size = new System.Drawing.Size(346, 110);
+            this.dgvRoleAssignedUsers.TabIndex = 4;
+            // 
+            // userNameDataGridViewTextBoxColumn2
+            // 
+            this.userNameDataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.userNameDataGridViewTextBoxColumn2.DataPropertyName = "UserName";
+            this.userNameDataGridViewTextBoxColumn2.HeaderText = "UserName";
+            this.userNameDataGridViewTextBoxColumn2.Name = "userNameDataGridViewTextBoxColumn2";
+            // 
+            // bsRoleUsers
+            // 
+            this.bsRoleUsers.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.User);
+            // 
+            // btnAddUserToRole
+            // 
+            this.btnAddUserToRole.Location = new System.Drawing.Point(469, 34);
+            this.btnAddUserToRole.Name = "btnAddUserToRole";
+            this.btnAddUserToRole.Size = new System.Drawing.Size(29, 23);
+            this.btnAddUserToRole.TabIndex = 3;
+            this.btnAddUserToRole.Text = "+";
+            this.btnAddUserToRole.UseVisualStyleBackColor = true;
+            this.btnAddUserToRole.Click += new System.EventHandler(this.btnAddUserToRole_Click);
+            // 
+            // btnRemoveUserFromRole
+            // 
+            this.btnRemoveUserFromRole.Location = new System.Drawing.Point(358, 34);
+            this.btnRemoveUserFromRole.Name = "btnRemoveUserFromRole";
+            this.btnRemoveUserFromRole.Size = new System.Drawing.Size(29, 23);
+            this.btnRemoveUserFromRole.TabIndex = 2;
+            this.btnRemoveUserFromRole.Text = "-";
+            this.btnRemoveUserFromRole.UseVisualStyleBackColor = true;
+            this.btnRemoveUserFromRole.Click += new System.EventHandler(this.btnRemoveUserFromRole_Click);
+            // 
+            // dgvRoleAvailableUsers
+            // 
+            this.dgvRoleAvailableUsers.AllowUserToAddRows = false;
+            this.dgvRoleAvailableUsers.AllowUserToDeleteRows = false;
+            this.dgvRoleAvailableUsers.AutoGenerateColumns = false;
+            this.dgvRoleAvailableUsers.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dgvRoleAvailableUsers.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.userNameDataGridViewTextBoxColumn1});
+            this.dgvRoleAvailableUsers.DataSource = this.bsUsers;
+            this.dgvRoleAvailableUsers.Location = new System.Drawing.Point(504, 34);
+            this.dgvRoleAvailableUsers.Name = "dgvRoleAvailableUsers";
+            this.dgvRoleAvailableUsers.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+            this.dgvRoleAvailableUsers.Size = new System.Drawing.Size(348, 110);
+            this.dgvRoleAvailableUsers.TabIndex = 1;
+            // 
+            // userNameDataGridViewTextBoxColumn1
+            // 
+            this.userNameDataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.userNameDataGridViewTextBoxColumn1.DataPropertyName = "UserName";
+            this.userNameDataGridViewTextBoxColumn1.HeaderText = "UserName";
+            this.userNameDataGridViewTextBoxColumn1.Name = "userNameDataGridViewTextBoxColumn1";
+            // 
+            // bsUserRoles
+            // 
+            this.bsUserRoles.DataSource = typeof(HeuristicLab.Services.Authentication.DataTransfer.Role);
+            // 
+            // Membership
+            // 
+            this.Membership.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
+            this.Membership.DataPropertyName = "Membership.Email";
+            this.Membership.HeaderText = "EMail";
+            this.Membership.Name = "Membership";
+            this.Membership.Width = 58;
+            // 
+            // isAnonymousDataGridViewCheckBoxColumn
+            // 
+            this.isAnonymousDataGridViewCheckBoxColumn.DataPropertyName = "IsAnonymous";
+            this.isAnonymousDataGridViewCheckBoxColumn.HeaderText = "IsAnonymous";
+            this.isAnonymousDataGridViewCheckBoxColumn.Name = "isAnonymousDataGridViewCheckBoxColumn";
             // 
             // userNameDataGridViewTextBoxColumn
             // 
+            this.userNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
             this.userNameDataGridViewTextBoxColumn.DataPropertyName = "UserName";
             this.userNameDataGridViewTextBoxColumn.HeaderText = "UserName";
             this.userNameDataGridViewTextBoxColumn.Name = "userNameDataGridViewTextBoxColumn";
             // 
-            // loweredUserNameDataGridViewTextBoxColumn
-            // 
-            this.loweredUserNameDataGridViewTextBoxColumn.DataPropertyName = "LoweredUserName";
-            this.loweredUserNameDataGridViewTextBoxColumn.HeaderText = "LoweredUserName";
-            this.loweredUserNameDataGridViewTextBoxColumn.Name = "loweredUserNameDataGridViewTextBoxColumn";
-            // 
-            // mobileAliasDataGridViewTextBoxColumn
-            // 
-            this.mobileAliasDataGridViewTextBoxColumn.DataPropertyName = "MobileAlias";
-            this.mobileAliasDataGridViewTextBoxColumn.HeaderText = "MobileAlias";
-            this.mobileAliasDataGridViewTextBoxColumn.Name = "mobileAliasDataGridViewTextBoxColumn";
-            // 
-            // isAnonymousDataGridViewCheckBoxColumn
-            // 
-            this.isAnonymousDataGridViewCheckBoxColumn.DataPropertyName = "IsAnonymous";
-            this.isAnonymousDataGridViewCheckBoxColumn.HeaderText = "IsAnonymous";
-            this.isAnonymousDataGridViewCheckBoxColumn.Name = "isAnonymousDataGridViewCheckBoxColumn";
-            // 
-            // lastActivityDateDataGridViewTextBoxColumn
-            // 
-            this.lastActivityDateDataGridViewTextBoxColumn.DataPropertyName = "LastActivityDate";
-            this.lastActivityDateDataGridViewTextBoxColumn.HeaderText = "LastActivityDate";
-            this.lastActivityDateDataGridViewTextBoxColumn.Name = "lastActivityDateDataGridViewTextBoxColumn";
-            // 
-            // tabPage3
-            // 
-            this.tabPage3.AutoScroll = true;
-            this.tabPage3.Controls.Add(emailLabel);
-            this.tabPage3.Controls.Add(this.emailTextBox);
-            this.tabPage3.Controls.Add(passwordSaltLabel);
-            this.tabPage3.Controls.Add(this.passwordSaltTextBox);
-            this.tabPage3.Controls.Add(passwordQuestionLabel);
-            this.tabPage3.Controls.Add(this.passwordQuestionTextBox);
-            this.tabPage3.Controls.Add(passwordAnswerLabel);
-            this.tabPage3.Controls.Add(this.passwordAnswerTextBox);
-            this.tabPage3.Controls.Add(passwordLabel);
-            this.tabPage3.Controls.Add(this.passwordTextBox);
-            this.tabPage3.Controls.Add(isAnonymousLabel);
-            this.tabPage3.Controls.Add(this.isAnonymousCheckBox);
-            this.tabPage3.Location = new System.Drawing.Point(4, 22);
-            this.tabPage3.Name = "tabPage3";
-            this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage3.Size = new System.Drawing.Size(1078, 159);
-            this.tabPage3.TabIndex = 0;
-            this.tabPage3.Text = "Detail";
-            this.tabPage3.UseVisualStyleBackColor = true;
-            // 
-            // isAnonymousLabel
-            // 
-            isAnonymousLabel.AutoSize = true;
-            isAnonymousLabel.Location = new System.Drawing.Point(15, 22);
-            isAnonymousLabel.Name = "isAnonymousLabel";
-            isAnonymousLabel.Size = new System.Drawing.Size(76, 13);
-            isAnonymousLabel.TabIndex = 0;
-            isAnonymousLabel.Text = "Is Anonymous:";
-            // 
-            // isAnonymousCheckBox
-            // 
-            this.isAnonymousCheckBox.DataBindings.Add(new System.Windows.Forms.Binding("CheckState", this.bsUsers, "IsAnonymous", true));
-            this.isAnonymousCheckBox.Location = new System.Drawing.Point(98, 17);
-            this.isAnonymousCheckBox.Name = "isAnonymousCheckBox";
-            this.isAnonymousCheckBox.Size = new System.Drawing.Size(104, 24);
-            this.isAnonymousCheckBox.TabIndex = 1;
-            this.isAnonymousCheckBox.Text = "checkBox1";
-            this.isAnonymousCheckBox.UseVisualStyleBackColor = true;
-            // 
-            // passwordLabel
-            // 
-            passwordLabel.AutoSize = true;
-            passwordLabel.Location = new System.Drawing.Point(15, 73);
-            passwordLabel.Name = "passwordLabel";
-            passwordLabel.Size = new System.Drawing.Size(56, 13);
-            passwordLabel.TabIndex = 2;
-            passwordLabel.Text = "Password:";
-            // 
-            // passwordTextBox
-            // 
-            this.passwordTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUsers, "Membership.Password", true));
-            this.passwordTextBox.Location = new System.Drawing.Point(98, 70);
-            this.passwordTextBox.Name = "passwordTextBox";
-            this.passwordTextBox.Size = new System.Drawing.Size(203, 20);
-            this.passwordTextBox.TabIndex = 3;
-            // 
-            // passwordAnswerLabel
-            // 
-            passwordAnswerLabel.AutoSize = true;
-            passwordAnswerLabel.Location = new System.Drawing.Point(318, 46);
-            passwordAnswerLabel.Name = "passwordAnswerLabel";
-            passwordAnswerLabel.Size = new System.Drawing.Size(94, 13);
-            passwordAnswerLabel.TabIndex = 4;
-            passwordAnswerLabel.Text = "Password Answer:";
-            // 
-            // passwordAnswerTextBox
-            // 
-            this.passwordAnswerTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUsers, "Membership.PasswordAnswer", true));
-            this.passwordAnswerTextBox.Location = new System.Drawing.Point(425, 43);
-            this.passwordAnswerTextBox.Name = "passwordAnswerTextBox";
-            this.passwordAnswerTextBox.Size = new System.Drawing.Size(188, 20);
-            this.passwordAnswerTextBox.TabIndex = 5;
-            // 
-            // passwordQuestionLabel
-            // 
-            passwordQuestionLabel.AutoSize = true;
-            passwordQuestionLabel.Location = new System.Drawing.Point(318, 73);
-            passwordQuestionLabel.Name = "passwordQuestionLabel";
-            passwordQuestionLabel.Size = new System.Drawing.Size(101, 13);
-            passwordQuestionLabel.TabIndex = 6;
-            passwordQuestionLabel.Text = "Password Question:";
-            // 
-            // passwordQuestionTextBox
-            // 
-            this.passwordQuestionTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUsers, "Membership.PasswordQuestion", true));
-            this.passwordQuestionTextBox.Location = new System.Drawing.Point(425, 70);
-            this.passwordQuestionTextBox.Name = "passwordQuestionTextBox";
-            this.passwordQuestionTextBox.Size = new System.Drawing.Size(188, 20);
-            this.passwordQuestionTextBox.TabIndex = 7;
-            // 
-            // passwordSaltLabel
-            // 
-            passwordSaltLabel.AutoSize = true;
-            passwordSaltLabel.Location = new System.Drawing.Point(15, 99);
-            passwordSaltLabel.Name = "passwordSaltLabel";
-            passwordSaltLabel.Size = new System.Drawing.Size(77, 13);
-            passwordSaltLabel.TabIndex = 8;
-            passwordSaltLabel.Text = "Password Salt:";
-            // 
-            // passwordSaltTextBox
-            // 
-            this.passwordSaltTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUsers, "Membership.PasswordSalt", true));
-            this.passwordSaltTextBox.Location = new System.Drawing.Point(99, 96);
-            this.passwordSaltTextBox.Name = "passwordSaltTextBox";
-            this.passwordSaltTextBox.Size = new System.Drawing.Size(202, 20);
-            this.passwordSaltTextBox.TabIndex = 9;
-            // 
-            // emailLabel
-            // 
-            emailLabel.AutoSize = true;
-            emailLabel.Location = new System.Drawing.Point(15, 46);
-            emailLabel.Name = "emailLabel";
-            emailLabel.Size = new System.Drawing.Size(35, 13);
-            emailLabel.TabIndex = 10;
-            emailLabel.Text = "Email:";
-            // 
-            // emailTextBox
-            // 
-            this.emailTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsUsers, "Membership.Email", true));
-            this.emailTextBox.Location = new System.Drawing.Point(98, 43);
-            this.emailTextBox.Name = "emailTextBox";
-            this.emailTextBox.Size = new System.Drawing.Size(203, 20);
-            this.emailTextBox.TabIndex = 11;
-            // 
-            // dataGridView1
-            // 
-            this.dataGridView1.AllowUserToAddRows = false;
-            this.dataGridView1.AllowUserToDeleteRows = false;
-            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dataGridView1.Location = new System.Drawing.Point(6, 22);
-            this.dataGridView1.Name = "dataGridView1";
-            this.dataGridView1.ReadOnly = true;
-            this.dataGridView1.Size = new System.Drawing.Size(437, 91);
-            this.dataGridView1.TabIndex = 0;
-            // 
-            // roleNameLabel
-            // 
-            roleNameLabel.AutoSize = true;
-            roleNameLabel.Location = new System.Drawing.Point(12, 22);
-            roleNameLabel.Name = "roleNameLabel";
-            roleNameLabel.Size = new System.Drawing.Size(63, 13);
-            roleNameLabel.TabIndex = 0;
-            roleNameLabel.Text = "Role Name:";
-            // 
-            // roleNameTextBox
-            // 
-            this.roleNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsRoles, "RoleName", true));
-            this.roleNameTextBox.Location = new System.Drawing.Point(81, 19);
-            this.roleNameTextBox.Name = "roleNameTextBox";
-            this.roleNameTextBox.Size = new System.Drawing.Size(191, 20);
-            this.roleNameTextBox.TabIndex = 1;
-            // 
-            // dataGridView2
-            // 
-            this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dataGridView2.Location = new System.Drawing.Point(34, 28);
-            this.dataGridView2.Name = "dataGridView2";
-            this.dataGridView2.Size = new System.Drawing.Size(520, 108);
-            this.dataGridView2.TabIndex = 0;
-            // 
-            // roleIdDataGridViewTextBoxColumn
-            // 
-            this.roleIdDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
-            this.roleIdDataGridViewTextBoxColumn.DataPropertyName = "RoleId";
-            this.roleIdDataGridViewTextBoxColumn.HeaderText = "Id";
-            this.roleIdDataGridViewTextBoxColumn.Name = "roleIdDataGridViewTextBoxColumn";
-            this.roleIdDataGridViewTextBoxColumn.Width = 41;
-            // 
-            // roleNameDataGridViewTextBoxColumn
-            // 
-            this.roleNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.roleNameDataGridViewTextBoxColumn.DataPropertyName = "RoleName";
-            this.roleNameDataGridViewTextBoxColumn.HeaderText = "Name";
-            this.roleNameDataGridViewTextBoxColumn.Name = "roleNameDataGridViewTextBoxColumn";
-            // 
-            // loweredRoleNameDataGridViewTextBoxColumn
-            // 
-            this.loweredRoleNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
-            this.loweredRoleNameDataGridViewTextBoxColumn.DataPropertyName = "LoweredRoleName";
-            this.loweredRoleNameDataGridViewTextBoxColumn.HeaderText = "Lowered Name";
-            this.loweredRoleNameDataGridViewTextBoxColumn.Name = "loweredRoleNameDataGridViewTextBoxColumn";
-            this.loweredRoleNameDataGridViewTextBoxColumn.Width = 96;
-            // 
-            // descriptionDataGridViewTextBoxColumn
-            // 
-            this.descriptionDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
-            this.descriptionDataGridViewTextBoxColumn.DataPropertyName = "Description";
-            this.descriptionDataGridViewTextBoxColumn.HeaderText = "Description";
-            this.descriptionDataGridViewTextBoxColumn.Name = "descriptionDataGridViewTextBoxColumn";
-            this.descriptionDataGridViewTextBoxColumn.Width = 85;
-            // 
             // UserManagement
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1100, 556);
+            this.ClientSize = new System.Drawing.Size(1100, 610);
             this.Controls.Add(this.scMain);
             this.Name = "UserManagement";
             this.Text = "UserManagement";
-            ((System.ComponentModel.ISupportInitialize)(this.bsUsers)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.bsRoles)).EndInit();
             this.scMain.Panel1.ResumeLayout(false);
             this.scMain.Panel2.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit();
             this.scMain.ResumeLayout(false);
+            this.panel1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bsApplications)).EndInit();
             this.tabControl1.ResumeLayout(false);
             this.tabPage1.ResumeLayout(false);
-            this.tabPage2.ResumeLayout(false);
-            this.tabControl2.ResumeLayout(false);
-            this.tabPage4.ResumeLayout(false);
-            this.tabControl3.ResumeLayout(false);
-            this.tabPage5.ResumeLayout(false);
-            this.tabPage5.PerformLayout();
-            this.tabPage6.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.dgvUsers)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.dgvRoles)).EndInit();
-            this.panel1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.bsUsers)).EndInit();
+            this.tcUser.ResumeLayout(false);
             this.tabPage3.ResumeLayout(false);
             this.tabPage3.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsUser)).EndInit();
+            this.tabPage2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.dgvRoles)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsRoles)).EndInit();
+            this.tcRole.ResumeLayout(false);
+            this.tpRoleDetail.ResumeLayout(false);
+            this.tpRoleDetail.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.bsRole)).EndInit();
+            this.tabPage6.ResumeLayout(false);
+            this.tabPage6.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dgvRoleAssignedUsers)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsRoleUsers)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dgvRoleAvailableUsers)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.bsUserRoles)).EndInit();
             this.ResumeLayout(false);
 
@@ -565,35 +701,46 @@
         private System.Windows.Forms.TabPage tabPage1;
         private System.Windows.Forms.DataGridView dgvUsers;
-        private System.Windows.Forms.TabControl tabControl2;
-        private System.Windows.Forms.TabPage tabPage4;
+        private System.Windows.Forms.TabControl tcUser;
         private System.Windows.Forms.TabPage tabPage2;
         private System.Windows.Forms.DataGridView dgvRoles;
-        private System.Windows.Forms.TabControl tabControl3;
-        private System.Windows.Forms.TabPage tabPage5;
+        private System.Windows.Forms.TabControl tcRole;
+        private System.Windows.Forms.TabPage tpRoleDetail;
         private System.Windows.Forms.TabPage tabPage6;
         private System.Windows.Forms.Panel panel1;
         private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn membershipDataGridViewTextBoxColumn;
-        private System.Windows.Forms.DataGridViewTextBoxColumn applicationIdDataGridViewTextBoxColumn;
-        private System.Windows.Forms.DataGridViewTextBoxColumn userIdDataGridViewTextBoxColumn;
-        private System.Windows.Forms.DataGridViewTextBoxColumn userNameDataGridViewTextBoxColumn;
-        private System.Windows.Forms.DataGridViewTextBoxColumn loweredUserNameDataGridViewTextBoxColumn;
-        private System.Windows.Forms.DataGridViewTextBoxColumn mobileAliasDataGridViewTextBoxColumn;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn isAnonymousDataGridViewCheckBoxColumn;
-        private System.Windows.Forms.DataGridViewTextBoxColumn lastActivityDateDataGridViewTextBoxColumn;
+        private System.Windows.Forms.TextBox roleNameTextBox;
+        private System.Windows.Forms.Button btnNewUser;
+        private System.Windows.Forms.BindingSource bsUser;
+        private System.Windows.Forms.Button btnNewRole;
+        private System.Windows.Forms.BindingSource bsRole;
+        private System.Windows.Forms.BindingSource bsUserRoles;
+        private System.Windows.Forms.BindingSource bsRoleUsers;
+        private System.Windows.Forms.DataGridView dgvRoleAvailableUsers;
+        private System.Windows.Forms.Button btnAddUserToRole;
+        private System.Windows.Forms.Button btnRemoveUserFromRole;
+        private System.Windows.Forms.Button btnSaveRole;
+        private System.Windows.Forms.TextBox descriptionTextBox;
+        private System.Windows.Forms.Button btnDeleteRole;
+        private System.Windows.Forms.DataGridView dgvRoleAssignedUsers;
+        private System.Windows.Forms.ComboBox cbxApplication;
+        private System.Windows.Forms.BindingSource bsApplications;
+        private System.Windows.Forms.Button btnDeleteUser;
         private System.Windows.Forms.TabPage tabPage3;
+        private System.Windows.Forms.Button btnSaveUser;
+        private System.Windows.Forms.TextBox passwordQuestionTextBox;
+        private System.Windows.Forms.TextBox passwordTextBox;
+        private System.Windows.Forms.TextBox userNameTextBox;
         private System.Windows.Forms.TextBox emailTextBox;
         private System.Windows.Forms.TextBox passwordSaltTextBox;
-        private System.Windows.Forms.TextBox passwordQuestionTextBox;
-        private System.Windows.Forms.TextBox passwordAnswerTextBox;
-        private System.Windows.Forms.TextBox passwordTextBox;
-        private System.Windows.Forms.CheckBox isAnonymousCheckBox;
-        private System.Windows.Forms.DataGridView dataGridView1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn roleIdDataGridViewTextBoxColumn;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.DataGridViewTextBoxColumn userNameDataGridViewTextBoxColumn2;
+        private System.Windows.Forms.DataGridViewTextBoxColumn userNameDataGridViewTextBoxColumn1;
         private System.Windows.Forms.DataGridViewTextBoxColumn roleNameDataGridViewTextBoxColumn;
         private System.Windows.Forms.DataGridViewTextBoxColumn loweredRoleNameDataGridViewTextBoxColumn;
         private System.Windows.Forms.DataGridViewTextBoxColumn descriptionDataGridViewTextBoxColumn;
-        private System.Windows.Forms.TextBox roleNameTextBox;
-        private System.Windows.Forms.DataGridView dataGridView2;
+        private System.Windows.Forms.DataGridViewTextBoxColumn userNameDataGridViewTextBoxColumn;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn isAnonymousDataGridViewCheckBoxColumn;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Membership;
     }
 }
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.cs	(revision 4725)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.cs	(revision 4726)
@@ -16,4 +16,5 @@
         AuthenticationService service;
         Guid applicationId = new Guid("04371D20-8FD4-4607-A632-42C8D186786B");
+       
 
         public UserManagement()
@@ -29,7 +30,150 @@
             if (service != null)
             {
-                this.bsRoles.DataSource = service.GetRoles(applicationId);
-                this.bsUsers.DataSource = service.GetUsers(applicationId);
 
+               
+                RefreshApplicationlist();
+            }
+        }
+
+        private void RefreshApplicationlist()
+        {
+            this.bsApplications.DataSource = service.GetApplications();
+            RefreshRolelist();
+            RefreshUserlist();
+        }
+
+        private void RefreshRolelist()
+        {
+            this.bsRoles.DataSource = service.GetRoles(applicationId);
+        }
+
+        private void RefreshUserlist()
+        {
+            this.bsUsers.DataSource = service.GetUsers(applicationId);
+        }
+
+        private void RefreshRoleUserlist(Guid roleId)
+        {
+            this.bsRoleUsers.DataSource = service.GetUsersInRole(roleId);
+        }
+
+        private void dgvUsers_SelectionChanged(object sender, EventArgs e)
+        {
+            // show detail
+            if(dgvUsers.SelectedRows.Count == 1){
+                User user = (User)dgvUsers.SelectedRows[0].DataBoundItem;
+                bsUser.DataSource = user;
+                bsUserRoles.DataSource = service.GetRolesForUser(user.UserId);
+                tcUser.Enabled = false;
+            }
+        }
+
+        private void dgvRoles_SelectionChanged(object sender, EventArgs e)
+        {
+            if (dgvRoles.SelectedRows.Count == 1)
+            {
+                Role role = (Role) dgvRoles.SelectedRows[0].DataBoundItem;
+                bsRole.DataSource = role;
+                IEnumerable<User> _l = service.GetUsersInRole(role.RoleId);
+                bsRoleUsers.DataSource = service.GetUsersInRole(role.RoleId);
+                btnDeleteRole.Enabled = true;
+                tcRole.Enabled = true;
+            }
+        }
+
+        private void btnNewRole_Click(object sender, EventArgs e)
+        {
+            // new Role
+            Role role = new Role();
+            role.ApplicationId = applicationId;
+            bsRole.DataSource = role;
+            tcRole.Enabled = true;
+        }
+
+        private void btnNewUser_Click(object sender, EventArgs e)
+        {
+            User user = new User();
+            user.ApplicationId = applicationId;
+            bsUser.DataSource = user;
+            tcUser.Enabled = true;
+        }
+
+        private void btnSaveUser_Click(object sender, EventArgs e)
+        {
+            User user = (User)bsUser.DataSource;
+            tcUser.Enabled = false;
+            service.InsertUser(user);
+            RefreshUserlist();
+            
+        }
+
+        private void btnSaveRole_Click(object sender, EventArgs e)
+        {
+           Role role = (Role)bsRole.DataSource;
+           role.ApplicationId = applicationId;
+           service.InsertRole(role);
+           tcRole.Enabled = false;
+           RefreshRolelist();
+        }
+
+       
+
+        private void btnAddUserToRole_Click(object sender, EventArgs e)
+        {
+            if (dgvRoleAvailableUsers.SelectedRows.Count == 1)
+            {
+                User user = (User)dgvRoleAvailableUsers.SelectedRows[0].DataBoundItem;
+                Role role = (Role)bsRole.DataSource;
+                role.ApplicationId = applicationId;
+                user.ApplicationId = applicationId;
+                service.AddUserToRole(role.RoleId, user.UserId);
+                RefreshRoleUserlist(role.RoleId);
+            }
+        }
+
+        private void btnDeleteRole_Click(object sender, EventArgs e)
+        {
+            if (dgvRoles.SelectedRows.Count == 1)
+            {
+                Role role = (Role)dgvRoles.SelectedRows[0].DataBoundItem;
+                service.DeleteRole(role.RoleId);
+                RefreshRolelist();
+            }
+        }
+
+        private void btnRemoveUserFromRole_Click(object sender, EventArgs e)
+        {
+            // remove from role ..
+            if (dgvRoleAssignedUsers.SelectedRows.Count == 1)
+            {
+                User user = (User)dgvRoleAssignedUsers.SelectedRows[0].DataBoundItem;
+                Role role = (Role)bsRole.DataSource;
+                
+                service.RemoveUserFromRole(role.RoleId, user.UserId);
+                RefreshRoleUserlist(role.RoleId);
+            }
+        }
+
+        private void cbxApplication_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            HeuristicLab.Services.Authentication.DataTransfer.Application application = (HeuristicLab.Services.Authentication.DataTransfer.Application)cbxApplication.SelectedItem;
+            if (application != null)
+            {
+                applicationId = application.ApplicationId;
+                RefreshApplicationlist();
+            }
+
+        }
+
+        private void btnDeleteUser_Click(object sender, EventArgs e)
+        {
+            if (dgvUsers.SelectedRows.Count == 1)
+            {
+                User user = (User)dgvUsers.SelectedRows[0].DataBoundItem;
+                if (user != null)
+                {
+                    service.DeleteUser(user.UserId);
+                    RefreshUserlist();
+                }
             }
         }
Index: /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.resx
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.resx	(revision 4725)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/UserManagement.resx	(revision 4726)
@@ -118,11 +118,8 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="bsUsers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
+  <metadata name="roleNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
   </metadata>
-  <metadata name="bsRoles.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>154, 17</value>
-  </metadata>
-  <metadata name="roleNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="descriptionLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>False</value>
   </metadata>
@@ -130,26 +127,8 @@
     <value>False</value>
   </metadata>
-  <metadata name="passwordSaltLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="passwordQuestionLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="passwordAnswerLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="userNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>False</value>
   </metadata>
   <metadata name="passwordLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="isAnonymousLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="isAnonymousLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="passwordLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="passwordAnswerLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>False</value>
   </metadata>
@@ -160,9 +139,42 @@
     <value>False</value>
   </metadata>
-  <metadata name="emailLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
+  <metadata name="Membership.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
   </metadata>
-  <metadata name="roleNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
+  <metadata name="bsUsers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="bsApplications.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 56</value>
+  </metadata>
+  <metadata name="bsApplications.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 56</value>
+  </metadata>
+  <metadata name="bsUser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>273, 17</value>
+  </metadata>
+  <metadata name="bsUser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>273, 17</value>
+  </metadata>
+  <metadata name="bsRoles.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>180, 17</value>
+  </metadata>
+  <metadata name="bsRoles.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>180, 17</value>
+  </metadata>
+  <metadata name="bsRole.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>480, 17</value>
+  </metadata>
+  <metadata name="bsRole.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>480, 17</value>
+  </metadata>
+  <metadata name="bsRoleUsers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>568, 17</value>
+  </metadata>
+  <metadata name="bsRoleUsers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>568, 17</value>
+  </metadata>
+  <metadata name="bsUserRoles.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>362, 17</value>
   </metadata>
 </root>
Index: /branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs	(revision 4725)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs	(revision 4726)
@@ -26,15 +26,17 @@
                                where item.UserId == id
                                select item;
-                    User user = Convert.ToDataTransfer((aspnet_User)User.Single());
+                    aspnet_User eUser = User.Single();
+
+                    User user = Convert.ToDataTransfer((aspnet_User)eUser);
 
                     if (user == null) { return null; }
 
-                    Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
-
-                    var Membership = from item in MembershipTable
-                                     where item.UserId == id
-                                     select item;
-
-                    Membership membership = Convert.ToDataTransfer((aspnet_Membership)Membership.Single());
+                    //Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
+
+                    //var Membership = from item in MembershipTable
+                    //                 where item.UserId == id
+                    //                 select item;
+
+                    Membership membership = Convert.ToDataTransfer((aspnet_Membership)eUser.aspnet_Membership);
 
                     if (membership == null) { return null; }
@@ -112,11 +114,11 @@
                         if (user== null) { return null; }
 
-                        Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
-
-                        var Membership = from item in MembershipTable
-                                         where item.UserId == user.UserId
-                                         select item;
-
-                        Membership membership = Convert.ToDataTransfer((aspnet_Membership)Membership.Single());
+                        //Table<aspnet_Membership> MembershipTable = db.GetTable<aspnet_Membership>();
+
+                        //var Membership = from item in MembershipTable
+                        //                 where item.UserId == user.UserId
+                        //                 select item;
+
+                        Membership membership = Convert.ToDataTransfer((aspnet_Membership)eUser.aspnet_Membership);
 
                         if (membership == null) { return null; }
@@ -456,5 +458,5 @@
                         Role role = GetRole(id);
 
-                        bool deleteOnlyIfRoleIsEmpty = true;
+                        bool deleteOnlyIfRoleIsEmpty = false;
                         if (role == null)
                         {
@@ -716,4 +718,37 @@
         }
 
+        public IEnumerable<DataTransfer.Application> GetApplications()
+        {
+            List<DataTransfer.Application> ApplicationList = new List<DataTransfer.Application>();
+            using (UserManagementDataContext db = new UserManagementDataContext())
+            {
+                try
+                {
+                    Table<aspnet_Application> ApplicationTable = db.GetTable<aspnet_Application>();
+                    var Applications = from item in ApplicationTable
+                                select item;
+                    foreach (var eApplication in Applications)
+                    {
+
+                        Application application = Convert.ToDataTransfer(eApplication);
+
+                        if (application == null) { return null; }
+
+
+                        ApplicationList.Add(application);
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Debug.WriteLine(ex.InnerException);
+                    return new List<Application>();
+                }
+            }
+
+            return ApplicationList;
+        }
+
+
+
         #endregion
 
Index: /branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs
===================================================================
--- /branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs	(revision 4725)
+++ /branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs	(revision 4726)
@@ -82,4 +82,8 @@
         [OperationContract]
         bool DeleteApplication(Application application);
+
+         [OperationContract]
+        IEnumerable<DataTransfer.Application> GetApplications();
+
         #endregion
 
