Changeset 4979
- Timestamp:
- 11/28/10 15:27:04 (14 years ago)
- Location:
- branches/UserManagement
- Files:
-
- 2 added
- 2 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Application.cs
r4964 r4979 8 8 { 9 9 [DataContract] 10 public class Application : NamedAuth Item {10 public class Application : NamedAuthenticationItem { 11 11 12 12 13 13 14 [DataMember]15 public string LoweredApplicationName { get; set; } // !!! REMOVE14 //[DataMember] 15 //public string LoweredApplicationName { get; set; } // !!! REMOVE 16 16 17 17 [DataMember] -
branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/HeuristicLab.Services.Authentication.DataTransfer.csproj
r4740 r4979 43 43 <ItemGroup> 44 44 <Compile Include="Application.cs" /> 45 <Compile Include="Auth Item.cs" />46 <Compile Include="NamedAuth Item.cs" />45 <Compile Include="AuthenticationItem.cs" /> 46 <Compile Include="NamedAuthenticationItem.cs" /> 47 47 <Compile Include="Role.cs" /> 48 48 <Compile Include="User.cs" /> -
branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/Role.cs
r4964 r4979 8 8 { 9 9 [DataContract] 10 public class Role : NamedAuth Item {10 public class Role : NamedAuthenticationItem { 11 11 12 12 public Role() 13 13 { 14 14 Name = ""; 15 LoweredRoleName = "";16 15 } 17 16 18 17 [DataMember] 19 18 public Guid ApplicationId { get; set; } 20 [DataMember]21 public string LoweredRoleName { get; set; } // !!! REMOVE19 //[DataMember] 20 //public string LoweredRoleName { get; set; } // !!! REMOVE 22 21 [DataMember] 23 22 public string Description { get; set; } -
branches/UserManagement/HeuristicLab.Services.Authentication.DataTransfer/User.cs
r4964 r4979 8 8 { 9 9 [DataContract] 10 public class User : NamedAuth Item {10 public class User : NamedAuthenticationItem { 11 11 12 12 public User() -
branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/AuthenticationClient.cs
r4962 r4979 53 53 #region Store 54 54 55 public bool Store(Auth Item item)55 public bool Store(AuthenticationItem item) 56 56 { 57 57 try … … 60 60 { 61 61 if (item is Role) 62 item.Id = CallService<Guid>(s => s. InsertRole((Role)item));62 item.Id = CallService<Guid>(s => s.AddRole((Role)item)); 63 63 else if (item is User) 64 item.Id = CallService<Guid>(s => s. InsertUser((User)item));64 item.Id = CallService<Guid>(s => s.AddUser((User)item)); 65 65 else if (item is Application) 66 item.Id = CallService<Guid>(s => s. InsertApplication((Application)item));66 item.Id = CallService<Guid>(s => s.AddApplication((Application)item)); 67 67 68 68 } … … 130 130 AuthenticationServiceClient client = new AuthenticationServiceClient(); 131 131 client.ClientCredentials.UserName.UserName = "Alice"; 132 client.ClientCredentials.UserName.Password = "YouWill Know";132 client.ClientCredentials.UserName.Password = "YouWillNeverKnow"; 133 133 client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None; 134 134 //AuthenticationServiceClient client = ClientFactory.Create<AuthenticationClient, IAuthenticationService>(); -
branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ServiceClients/AuthenticationServiceClient.cs
r4962 r4979 1 1 //------------------------------------------------------------------------------ 2 2 // <auto-generated> 3 // This code was generated by a tool.4 // Runtime Version:4.0.30319.13 // Dieser Code wurde von einem Tool generiert. 4 // Laufzeitversion:4.0.30319.1 5 5 // 6 // Changes to this file may cause incorrect behavior and will be lost if7 // the code is regenerated.6 // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn 7 // der Code erneut generiert wird. 8 8 // </auto-generated> 9 9 //------------------------------------------------------------------------------ … … 16 16 [System.Diagnostics.DebuggerStepThroughAttribute()] 17 17 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 18 [System.Runtime.Serialization.DataContractAttribute(Name="Auth Item", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" +18 [System.Runtime.Serialization.DataContractAttribute(Name="AuthenticationItem", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" + 19 19 "Transfer")] 20 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.NamedAuth Item))]20 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.NamedAuthenticationItem))] 21 21 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.Role))] 22 22 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.Application))] 23 23 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.User))] 24 public partial class Auth Item : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged24 public partial class AuthenticationItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged 25 25 { 26 26 … … 72 72 [System.Diagnostics.DebuggerStepThroughAttribute()] 73 73 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 74 [System.Runtime.Serialization.DataContractAttribute(Name="NamedAuth Item", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" +74 [System.Runtime.Serialization.DataContractAttribute(Name="NamedAuthenticationItem", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" + 75 75 "Transfer")] 76 76 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.Role))] 77 77 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.Application))] 78 78 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Services.Authentication.User))] 79 public partial class NamedAuth Item : HeuristicLab.Services.Authentication.AuthItem79 public partial class NamedAuthenticationItem : HeuristicLab.Services.Authentication.AuthenticationItem 80 80 { 81 81 … … 104 104 [System.Runtime.Serialization.DataContractAttribute(Name="Role", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" + 105 105 "Transfer")] 106 public partial class Role : HeuristicLab.Services.Authentication.NamedAuth Item106 public partial class Role : HeuristicLab.Services.Authentication.NamedAuthenticationItem 107 107 { 108 108 … … 110 110 111 111 private string DescriptionField; 112 113 private string LoweredRoleNameField;114 112 115 113 [System.Runtime.Serialization.DataMemberAttribute()] … … 143 141 this.DescriptionField = value; 144 142 this.RaisePropertyChanged("Description"); 145 }146 }147 }148 149 [System.Runtime.Serialization.DataMemberAttribute()]150 public string LoweredRoleName151 {152 get153 {154 return this.LoweredRoleNameField;155 }156 set157 {158 if ((object.ReferenceEquals(this.LoweredRoleNameField, value) != true))159 {160 this.LoweredRoleNameField = value;161 this.RaisePropertyChanged("LoweredRoleName");162 143 } 163 144 } … … 169 150 [System.Runtime.Serialization.DataContractAttribute(Name="Application", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" + 170 151 "Transfer")] 171 public partial class Application : HeuristicLab.Services.Authentication.NamedAuth Item152 public partial class Application : HeuristicLab.Services.Authentication.NamedAuthenticationItem 172 153 { 173 154 174 155 private string DescriptionField; 175 176 private string LoweredApplicationNameField;177 156 178 157 [System.Runtime.Serialization.DataMemberAttribute()] … … 189 168 this.DescriptionField = value; 190 169 this.RaisePropertyChanged("Description"); 191 }192 }193 }194 195 [System.Runtime.Serialization.DataMemberAttribute()]196 public string LoweredApplicationName197 {198 get199 {200 return this.LoweredApplicationNameField;201 }202 set203 {204 if ((object.ReferenceEquals(this.LoweredApplicationNameField, value) != true))205 {206 this.LoweredApplicationNameField = value;207 this.RaisePropertyChanged("LoweredApplicationName");208 170 } 209 171 } … … 215 177 [System.Runtime.Serialization.DataContractAttribute(Name="User", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Authentication.Data" + 216 178 "Transfer")] 217 public partial class User : HeuristicLab.Services.Authentication.NamedAuth Item179 public partial class User : HeuristicLab.Services.Authentication.NamedAuthenticationItem 218 180 { 219 181 … … 455 417 HeuristicLab.Services.Authentication.User GetUser(System.Guid id); 456 418 419 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetAllUsers", ReplyAction="http://tempuri.org/IAuthenticationService/GetAllUsersResponse")] 420 HeuristicLab.Services.Authentication.User[] GetAllUsers(); 421 457 422 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetUsers", ReplyAction="http://tempuri.org/IAuthenticationService/GetUsersResponse")] 458 423 HeuristicLab.Services.Authentication.User[] GetUsers(System.Guid applicationId); 459 424 460 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/ InsertUser", ReplyAction="http://tempuri.org/IAuthenticationService/InsertUserResponse")]461 System.Guid InsertUser(HeuristicLab.Services.Authentication.User user);425 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/AddUser", ReplyAction="http://tempuri.org/IAuthenticationService/AddUserResponse")] 426 System.Guid AddUser(HeuristicLab.Services.Authentication.User user); 462 427 463 428 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/DeleteUser", ReplyAction="http://tempuri.org/IAuthenticationService/DeleteUserResponse")] … … 470 435 bool AddUserToRole(System.Guid roleId, System.Guid userId); 471 436 437 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetUsersInRole", ReplyAction="http://tempuri.org/IAuthenticationService/GetUsersInRoleResponse")] 438 System.Guid[] GetUsersInRole(System.Guid roleId); 439 472 440 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/RemoveUserFromRole", ReplyAction="http://tempuri.org/IAuthenticationService/RemoveUserFromRoleResponse")] 473 441 bool RemoveUserFromRole(System.Guid roleId, System.Guid userId); 474 442 475 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/ GetRolesForUser", ReplyAction="http://tempuri.org/IAuthenticationService/GetRolesForUserResponse")]476 HeuristicLab.Services.Authentication.Role[] GetRolesForUser(System.Guid userId);443 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/IsUserInRole", ReplyAction="http://tempuri.org/IAuthenticationService/IsUserInRoleResponse")] 444 bool IsUserInRole(System.Guid userId, System.Guid roleId); 477 445 478 446 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetRole", ReplyAction="http://tempuri.org/IAuthenticationService/GetRoleResponse")] 479 447 HeuristicLab.Services.Authentication.Role GetRole(System.Guid id); 480 448 449 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetAllRoles", ReplyAction="http://tempuri.org/IAuthenticationService/GetAllRolesResponse")] 450 HeuristicLab.Services.Authentication.Role[] GetAllRoles(); 451 481 452 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetRoles", ReplyAction="http://tempuri.org/IAuthenticationService/GetRolesResponse")] 482 453 HeuristicLab.Services.Authentication.Role[] GetRoles(System.Guid applicationId); 483 454 484 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/ InsertRole", ReplyAction="http://tempuri.org/IAuthenticationService/InsertRoleResponse")]485 System.Guid InsertRole(HeuristicLab.Services.Authentication.Role role);455 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/AddRole", ReplyAction="http://tempuri.org/IAuthenticationService/AddRoleResponse")] 456 System.Guid AddRole(HeuristicLab.Services.Authentication.Role role); 486 457 487 458 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/UpdateRole", ReplyAction="http://tempuri.org/IAuthenticationService/UpdateRoleResponse")] … … 491 462 bool DeleteRole(System.Guid id); 492 463 493 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/Get UsersInRole", ReplyAction="http://tempuri.org/IAuthenticationService/GetUsersInRoleResponse")]494 HeuristicLab.Services.Authentication.User[] GetUsersInRole(System.Guid roleId);464 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetRolesForUser", ReplyAction="http://tempuri.org/IAuthenticationService/GetRolesForUserResponse")] 465 System.Guid[] GetRolesForUser(System.Guid userId); 495 466 496 467 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/GetApplication", ReplyAction="http://tempuri.org/IAuthenticationService/GetApplicationResponse")] 497 468 HeuristicLab.Services.Authentication.Application GetApplication(System.Guid id); 498 469 499 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/ InsertApplication", ReplyAction="http://tempuri.org/IAuthenticationService/InsertApplicationResponse")]500 System.Guid InsertApplication(HeuristicLab.Services.Authentication.Application application);470 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/AddApplication", ReplyAction="http://tempuri.org/IAuthenticationService/AddApplicationResponse")] 471 System.Guid AddApplication(HeuristicLab.Services.Authentication.Application application); 501 472 502 473 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAuthenticationService/DeleteApplication", ReplyAction="http://tempuri.org/IAuthenticationService/DeleteApplicationResponse")] … … 549 520 } 550 521 522 public HeuristicLab.Services.Authentication.User[] GetAllUsers() 523 { 524 return base.Channel.GetAllUsers(); 525 } 526 551 527 public HeuristicLab.Services.Authentication.User[] GetUsers(System.Guid applicationId) 552 528 { … … 554 530 } 555 531 556 public System.Guid InsertUser(HeuristicLab.Services.Authentication.User user)557 { 558 return base.Channel. InsertUser(user);532 public System.Guid AddUser(HeuristicLab.Services.Authentication.User user) 533 { 534 return base.Channel.AddUser(user); 559 535 } 560 536 … … 574 550 } 575 551 552 public System.Guid[] GetUsersInRole(System.Guid roleId) 553 { 554 return base.Channel.GetUsersInRole(roleId); 555 } 556 576 557 public bool RemoveUserFromRole(System.Guid roleId, System.Guid userId) 577 558 { … … 579 560 } 580 561 581 public HeuristicLab.Services.Authentication.Role[] GetRolesForUser(System.Guid userId) 562 public bool IsUserInRole(System.Guid userId, System.Guid roleId) 563 { 564 return base.Channel.IsUserInRole(userId, roleId); 565 } 566 567 public HeuristicLab.Services.Authentication.Role GetRole(System.Guid id) 568 { 569 return base.Channel.GetRole(id); 570 } 571 572 public HeuristicLab.Services.Authentication.Role[] GetAllRoles() 573 { 574 return base.Channel.GetAllRoles(); 575 } 576 577 public HeuristicLab.Services.Authentication.Role[] GetRoles(System.Guid applicationId) 578 { 579 return base.Channel.GetRoles(applicationId); 580 } 581 582 public System.Guid AddRole(HeuristicLab.Services.Authentication.Role role) 583 { 584 return base.Channel.AddRole(role); 585 } 586 587 public bool UpdateRole(HeuristicLab.Services.Authentication.Role role) 588 { 589 return base.Channel.UpdateRole(role); 590 } 591 592 public bool DeleteRole(System.Guid id) 593 { 594 return base.Channel.DeleteRole(id); 595 } 596 597 public System.Guid[] GetRolesForUser(System.Guid userId) 582 598 { 583 599 return base.Channel.GetRolesForUser(userId); 584 600 } 585 601 586 public HeuristicLab.Services.Authentication.Role GetRole(System.Guid id)587 {588 return base.Channel.GetRole(id);589 }590 591 public HeuristicLab.Services.Authentication.Role[] GetRoles(System.Guid applicationId)592 {593 return base.Channel.GetRoles(applicationId);594 }595 596 public System.Guid InsertRole(HeuristicLab.Services.Authentication.Role role)597 {598 return base.Channel.InsertRole(role);599 }600 601 public bool UpdateRole(HeuristicLab.Services.Authentication.Role role)602 {603 return base.Channel.UpdateRole(role);604 }605 606 public bool DeleteRole(System.Guid id)607 {608 return base.Channel.DeleteRole(id);609 }610 611 public HeuristicLab.Services.Authentication.User[] GetUsersInRole(System.Guid roleId)612 {613 return base.Channel.GetUsersInRole(roleId);614 }615 616 602 public HeuristicLab.Services.Authentication.Application GetApplication(System.Guid id) 617 603 { … … 619 605 } 620 606 621 public System.Guid InsertApplication(HeuristicLab.Services.Authentication.Application application)622 { 623 return base.Channel. InsertApplication(application);607 public System.Guid AddApplication(HeuristicLab.Services.Authentication.Application application) 608 { 609 return base.Channel.AddApplication(application); 624 610 } 625 611 -
branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/app.config
r4962 r4979 29 29 name="WSHttpBinding_IAuthenticationService"> 30 30 <identity> 31 <certificate encodedValue="AwAAAAEAAAAUAAAA AV7xMfFtgnY5+8sJyWRHHa0QvTcgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhBXQX+6QCO6m0LTqFCaKnh3MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMDkyNzE5MTIxNFoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDa4H45oXaRry7PwK3dI6AJWpxyEqmDBP+SnIZelLsPfWQ1oFPqH1zygaza0ZP+Gq5kxrL2cRrS9eiq/AlacWMOFsIEM6SZ/HBsaA9IiHssv3KH4uKwjcOWP1/TwL1OlwGDJszXrGmslrdFXg6I3grFlks8nYPVmuIzwVfmUKO+nwIDAQABo0kwRzBFBgNVHQEEPjA8gBDRH5aGMOUZ99XrCILH02uuoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghBXQX+6QCO6m0LTqFCaKnh3MAkGBSsOAwIdBQADgYEAtRZiYmZ7mKH0wkDd8v+33g8KU8mFiBS26hUowCpcCvYpG23FaVXbBua+zTt45RIBcEQUVdLOdtIAMogymV4sq9JafaU2Y9Dh9gnSqOF2KplC/xyf5f+QWwCZ4Yljr9g1BizWoOE6SF1TcjL66iZ09JMwYJKO9V3iuOosnzJ8DEA=" />31 <certificate encodedValue="AwAAAAEAAAAUAAAAXL2k/dCMiB3+7a8y6zepgAUMPdcgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhB0J9LOt5NHpkN1DGclpr/0MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMDkyMTE4MDIwN1oXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC73VKB25OrytpquyozHwo7d711Z4KEQEWHIigtJufMBUIzpQWXQrySaYrOdjZxuDJE8M7+kUi6FJny3o48Z8ZEEIKdoy4fJ+o5+rXKKNyg3rZxae1KJm4kQ3rIRu68b3cu6EYvFymORNo+gv8A03IbA2F7K1vaQbuRDAdbP8CT+QIDAQABo0kwRzBFBgNVHQEEPjA8gBC/lrDi96sGW7ZLNecSjhFEoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghB0J9LOt5NHpkN1DGclpr/0MAkGBSsOAwIdBQADgYEAdls1HmJKAhEUZvCcg/ELZYpRHF3ds5mHsYrNNhEoUTrHYJzsXDqxLMyn9nbKQHv+kBH7tdgF61agYvy3666D7EHPMXyEk6OwCVxIvOyNaHywS0v7/fyU/394VpzFNmkuycaiemEZFhqxstKN6n4PzBqOJfUmIE9Ry/mnlp6T2Zo=" /> 32 32 </identity> 33 33 </endpoint> -
branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/Program.cs
r4962 r4979 20 20 Console.WriteLine(app.Name); 21 21 } 22 Console.WriteLine(" Users "); 23 IEnumerable<User> users = AuthenticationClient.Instance.Users; 24 25 foreach (User u in users) { 26 Console.WriteLine(u.Name); 27 } 22 28 Console.ReadLine(); 23 29 -
branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/UserManagement.cs
r4789 r4979 79 79 // insert 80 80 selectedApplication.Id = Guid.NewGuid(); 81 auth. InsertApplication(selectedApplication);81 auth.AddApplication(selectedApplication); 82 82 } 83 83 else … … 127 127 selectedRole.ApplicationId = currentApplication.Id; 128 128 129 auth. InsertRole(selectedRole);129 auth.AddRole(selectedRole); 130 130 } 131 131 else … … 183 183 selectedUser.ApplicationId = currentApplication.Id; 184 184 185 auth. InsertUser(selectedUser);185 auth.AddUser(selectedUser); 186 186 } 187 187 else -
branches/UserManagement/HeuristicLab.Services.Authentication.TestClient2/app.config
r4962 r4979 29 29 name="WSHttpBinding_IAuthenticationService"> 30 30 <identity> 31 <certificate encodedValue="AwAAAAEAAAAUAAAA AV7xMfFtgnY5+8sJyWRHHa0QvTcgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhBXQX+6QCO6m0LTqFCaKnh3MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMDkyNzE5MTIxNFoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDa4H45oXaRry7PwK3dI6AJWpxyEqmDBP+SnIZelLsPfWQ1oFPqH1zygaza0ZP+Gq5kxrL2cRrS9eiq/AlacWMOFsIEM6SZ/HBsaA9IiHssv3KH4uKwjcOWP1/TwL1OlwGDJszXrGmslrdFXg6I3grFlks8nYPVmuIzwVfmUKO+nwIDAQABo0kwRzBFBgNVHQEEPjA8gBDRH5aGMOUZ99XrCILH02uuoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghBXQX+6QCO6m0LTqFCaKnh3MAkGBSsOAwIdBQADgYEAtRZiYmZ7mKH0wkDd8v+33g8KU8mFiBS26hUowCpcCvYpG23FaVXbBua+zTt45RIBcEQUVdLOdtIAMogymV4sq9JafaU2Y9Dh9gnSqOF2KplC/xyf5f+QWwCZ4Yljr9g1BizWoOE6SF1TcjL66iZ09JMwYJKO9V3iuOosnzJ8DEA=" />31 <certificate encodedValue="AwAAAAEAAAAUAAAAXL2k/dCMiB3+7a8y6zepgAUMPdcgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhB0J9LOt5NHpkN1DGclpr/0MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMDkyMTE4MDIwN1oXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC73VKB25OrytpquyozHwo7d711Z4KEQEWHIigtJufMBUIzpQWXQrySaYrOdjZxuDJE8M7+kUi6FJny3o48Z8ZEEIKdoy4fJ+o5+rXKKNyg3rZxae1KJm4kQ3rIRu68b3cu6EYvFymORNo+gv8A03IbA2F7K1vaQbuRDAdbP8CT+QIDAQABo0kwRzBFBgNVHQEEPjA8gBC/lrDi96sGW7ZLNecSjhFEoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghB0J9LOt5NHpkN1DGclpr/0MAkGBSsOAwIdBQADgYEAdls1HmJKAhEUZvCcg/ELZYpRHF3ds5mHsYrNNhEoUTrHYJzsXDqxLMyn9nbKQHv+kBH7tdgF61agYvy3666D7EHPMXyEk6OwCVxIvOyNaHywS0v7/fyU/394VpzFNmkuycaiemEZFhqxstKN6n4PzBqOJfUmIE9Ry/mnlp6T2Zo=" /> 32 32 </identity> 33 33 </endpoint> -
branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs
r4962 r4979 31 31 } 32 32 33 public IEnumerable<DataTransfer.User> GetAllUsers() { 34 List<DataTransfer.User> userList = new List<DataTransfer.User>(); 35 using (UserManagementDataContext db = new UserManagementDataContext()) { 36 var users = db.aspnet_Users.ToList<aspnet_User>(); 37 foreach (aspnet_User user in users) { 38 var membership = db.aspnet_Memberships.Where(x => x.UserId == user.UserId).FirstOrDefault(); 39 userList.Add(Convert.ToDataTransfer(user, membership)); 40 } 41 } 42 43 return userList; 44 } 45 33 46 public IEnumerable<DataTransfer.User> GetUsers(Guid applicationId) 34 47 { … … 52 65 } 53 66 54 public Guid InsertUser(User user)67 public Guid AddUser(User user) 55 68 { 56 69 if (user != null) … … 138 151 139 152 153 public bool AddUserToRole(Guid roleId, Guid userId) { 154 using (UserManagementDataContext db = new UserManagementDataContext()) { 155 try { 156 aspnet_UsersInRole r = new aspnet_UsersInRole(); 157 r.RoleId = roleId; 158 r.UserId = userId; 159 db.aspnet_UsersInRoles.InsertOnSubmit(r); 160 db.SubmitChanges(); 161 return true; 162 } 163 catch (Exception ex) { 164 Debug.WriteLine(ex.InnerException); 165 return false; 166 } 167 } 168 } 169 170 public IEnumerable<Guid> GetUsersInRole(Guid roleId) { 171 List<Guid> userList = new List<Guid>(); 172 using (UserManagementDataContext db = new UserManagementDataContext()) { 173 try { 174 var users = db.aspnet_UsersInRoles.Where(x => x.RoleId == roleId).ToList<aspnet_UsersInRole>(); 175 176 foreach (aspnet_UsersInRole u in users) { 177 userList.Add(GetUser(u.UserId).Id); 178 } 179 180 } 181 catch (Exception ex) { 182 Debug.WriteLine(ex.InnerException); 183 return new List<Guid>(); 184 185 } 186 187 } 188 189 return userList; 190 } 191 192 /* 193 public IEnumerable<User> GetUsersInRole(Guid roleId) { 194 List<User> userList = new List<User>(); 195 using (UserManagementDataContext db = new UserManagementDataContext()) { 196 try { 197 var users = db.aspnet_UsersInRoles.Where(x => x.RoleId == roleId).ToList<aspnet_UsersInRole>(); 198 199 foreach (aspnet_UsersInRole u in users) { 200 userList.Add(GetUser(u.UserId)); 201 202 } 203 204 } 205 catch (Exception ex) { 206 Debug.WriteLine(ex.InnerException); 207 return new List<User>(); 208 } 209 } 210 211 return userList; 212 } 213 */ 214 215 public bool IsUserInRole(Guid userId, Guid roleId) { 216 bool isInRole = false; 217 using (UserManagementDataContext db = new UserManagementDataContext()) { 218 var users = db.aspnet_UsersInRoles.Where(x => x.RoleId == roleId && x.UserId == userId).ToList<aspnet_UsersInRole>(); 219 foreach (aspnet_UsersInRole u in users) { 220 isInRole = true; 221 } 222 } 223 return isInRole; 224 225 } 226 227 228 public bool RemoveUserFromRole(Guid roleId, Guid userId) { 229 using (UserManagementDataContext db = new UserManagementDataContext()) { 230 try { 231 var role = db.aspnet_UsersInRoles.Where(x => x.RoleId == roleId && x.UserId == userId).FirstOrDefault(); 232 233 db.aspnet_UsersInRoles.DeleteOnSubmit(role); 234 db.SubmitChanges(); 235 return true; 236 237 } 238 catch (Exception ex) { 239 Debug.WriteLine(ex.InnerException); 240 return false; 241 } 242 } 243 244 } 245 246 247 140 248 141 249 #endregion … … 154 262 } 155 263 264 public IEnumerable<Role> GetAllRoles() { 265 List<DataTransfer.Role> roleList = new List<DataTransfer.Role>(); 266 using (UserManagementDataContext db = new UserManagementDataContext()) { 267 var roles = db.aspnet_Roles.ToList<aspnet_Role>(); 268 foreach (aspnet_Role role in roles) { 269 roleList.Add(Convert.ToDataTransfer(role)); 270 } 271 } 272 return roleList; 273 } 274 156 275 public IEnumerable<Role> GetRoles(Guid applicationId) 157 276 { … … 170 289 } 171 290 172 public Guid InsertRole(Role role)291 public Guid AddRole(Role role) 173 292 { 174 293 … … 220 339 } 221 340 222 public bool AddUserToRole(Guid roleId, Guid userId) 223 { 341 public IEnumerable<Guid> GetRolesForUser(Guid userId) { 342 List<Guid> roleList = new List<Guid>(); 343 using (UserManagementDataContext db = new UserManagementDataContext()) { 344 try { 345 var roles = db.aspnet_UsersInRoles.Where(x => x.UserId == userId).ToList<aspnet_UsersInRole>(); 346 foreach (aspnet_UsersInRole r in roles) { 347 roleList.Add(GetRole(r.RoleId).Id); 348 } 349 } 350 catch (Exception ex) { 351 Debug.WriteLine(ex.InnerException); 352 return new List<Guid>(); 353 } 354 } 355 356 return roleList; 357 358 } 359 360 /* 361 public IEnumerable<Role> GetRolesForUser(Guid userId) 362 { 363 List<Role> roleList = new List<Role>(); 224 364 using (UserManagementDataContext db = new UserManagementDataContext()) 225 365 { 226 366 try 227 367 { 228 aspnet_UsersInRole r = new aspnet_UsersInRole(); 229 r.RoleId = roleId; 230 r.UserId = userId; 231 db.aspnet_UsersInRoles.InsertOnSubmit(r); 232 db.SubmitChanges(); 233 return true; 234 } 235 catch (Exception ex) 236 { 237 Debug.WriteLine(ex.InnerException); 238 return false; 239 } 240 } 241 } 242 243 public bool RemoveUserFromRole(Guid roleId, Guid userId) 244 { 245 using (UserManagementDataContext db = new UserManagementDataContext()) 246 { 247 try 248 { 249 var role = db.aspnet_UsersInRoles.Where(x => x.RoleId == roleId && x.UserId == userId).FirstOrDefault(); 250 251 db.aspnet_UsersInRoles.DeleteOnSubmit(role); 252 db.SubmitChanges(); 253 return true; 254 255 } 256 catch (Exception ex) 257 { 258 Debug.WriteLine(ex.InnerException); 259 return false; 260 } 261 } 262 263 } 264 265 public IEnumerable<Role> GetRolesForUser(Guid userId) 266 { 267 List<Role> roleList = new List<Role>(); 268 using (UserManagementDataContext db = new UserManagementDataContext()) 269 { 270 try 271 { 272 var roles = db.aspnet_UsersInRoles.Where(x => x.UserId == userId).ToList<aspnet_UsersInRole>(); 368 var roles = db.aspnet_UsersInRoles.Where(x => x.UserId == userId).ToList<aspnet_UsersINRole>(); 273 369 274 370 foreach (aspnet_UsersInRole r in roles) … … 288 384 return roleList; 289 385 } 290 291 public IEnumerable<User> GetUsersInRole(Guid roleId) 292 { 293 List<User> userList = new List<User>(); 294 using (UserManagementDataContext db = new UserManagementDataContext()) 295 { 296 try 297 { 298 var users = db.aspnet_UsersInRoles.Where(x => x.RoleId == roleId).ToList<aspnet_UsersInRole>(); 299 300 foreach (aspnet_UsersInRole u in users) 301 { 302 userList.Add(GetUser(u.UserId)); 303 304 } 305 306 } 307 catch (Exception ex) 308 { 309 Debug.WriteLine(ex.InnerException); 310 return new List<User>(); 311 } 312 } 313 314 return userList; 315 } 386 */ 316 387 317 388 … … 353 424 #region Application 354 425 355 public Guid InsertApplication(Application application)426 public Guid AddApplication(Application application) 356 427 { 357 428 if (application != null) -
branches/UserManagement/HeuristicLab.Services.Authentication/Convert.cs
r4926 r4979 92 92 Id = source.ApplicationId, 93 93 Name = source.ApplicationName, 94 LoweredApplicationName = source.LoweredApplicationName,94 //LoweredApplicationName = source.LoweredApplicationName, 95 95 Description = source.Description 96 96 }; … … 108 108 target.ApplicationId = source.Id; 109 109 target.ApplicationName = source.Name; 110 target.LoweredApplicationName = source. LoweredApplicationName;110 target.LoweredApplicationName = source.Name.ToLower(); 111 111 target.Description = source.Description; 112 112 } … … 132 132 Name = source.RoleName, 133 133 Description = source.Description, 134 LoweredRoleName = source.LoweredRoleName,134 //LoweredRoleName = source.LoweredRoleName, 135 135 }; 136 136 } … … 148 148 target.RoleId = source.Id; 149 149 target.RoleName = source.Name; 150 target.LoweredRoleName = source. LoweredRoleName;150 target.LoweredRoleName = source.Name.ToLower(); 151 151 target.Description = source.Description; 152 152 } -
branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs
r4964 r4979 15 15 User GetUser(Guid id); 16 16 17 18 // IEnumerable<User> GetUsers();17 [OperationContract] 18 IEnumerable<User> GetAllUsers(); 19 19 20 20 [OperationContract] … … 22 22 23 23 [OperationContract] 24 Guid InsertUser(User user); // => AddUser24 Guid AddUser(User user); 25 25 26 26 [OperationContract] … … 34 34 35 35 [OperationContract] 36 IEnumerable<Guid> GetUsersInRole(Guid roleId); 37 38 //[OperationContract] 39 //IEnumerable<User> GetUsersInRole(Guid roleId); // return = Guid 40 41 [OperationContract] 36 42 bool RemoveUserFromRole(Guid roleId, Guid userId); 37 43 38 44 [OperationContract] 39 IEnumerable<Role> GetRolesForUser(Guid userId); // returnvalue = GUID 40 41 42 // IsUserInRole 43 // 45 bool IsUserInRole(Guid userId, Guid roleId); 44 46 45 47 #endregion … … 50 52 Role GetRole(Guid id); 51 53 52 53 //IEnumerable<Role> GetRoles();54 [OperationContract] 55 IEnumerable<Role> GetAllRoles(); 54 56 55 57 [OperationContract] … … 57 59 58 60 [OperationContract] 59 Guid InsertRole(Role role); // Add61 Guid AddRole(Role role); 60 62 61 63 [OperationContract] … … 65 67 bool DeleteRole(Guid id); 66 68 69 67 70 [OperationContract] 68 IEnumerable<User> GetUsersInRole(Guid roleId); // return = Guid 71 IEnumerable<Guid> GetRolesForUser(Guid userId); 72 73 74 //[OperationContract] 75 //IEnumerable<Role> GetRolesForUser(Guid userId); // returnvalue = GUID 69 76 70 77 #endregion … … 76 83 77 84 [OperationContract] 78 Guid InsertApplication(Application application); // ADD85 Guid AddApplication(Application application); // ADD 79 86 80 87 [OperationContract]
Note: See TracChangeset
for help on using the changeset viewer.