Changeset 7436 for branches/ClientUserManagement
- Timestamp:
- 01/31/12 22:54:22 (13 years ago)
- Location:
- branches/ClientUserManagement
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/AccessClient.cs
r7426 r7436 108 108 109 109 #region Helpers 110 p rivatestatic void CallRunCreationService(Action<IAccessService> call) {110 public static void CallRunCreationService(Action<IAccessService> call) { 111 111 AccessServiceClient client = ClientFactory.CreateClient<AccessServiceClient, IAccessService>(); 112 112 try { … … 122 122 } 123 123 } 124 p rivatestatic T CallRunCreationService<T>(Func<IAccessService, T> call) {124 public static T CallRunCreationService<T>(Func<IAccessService, T> call) { 125 125 AccessServiceClient client = ClientFactory.CreateClient<AccessServiceClient, IAccessService>(); 126 126 try { -
branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/HeuristicLab.Clients.Access-3.3.csproj
r7426 r7436 104 104 <Compile Include="ServiceClients\UserGroup.cs" /> 105 105 <Compile Include="ServiceClients\UserGroupBase.cs" /> 106 <Compile Include="UserInformation.cs" /> 106 107 <Compile Include="Views\LightweightUserGroupSelectionDialog.cs"> 107 108 <SubType>Form</SubType> -
branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ServiceClients/AccessServiceClient.cs
r7426 r7436 17 17 "")] 18 18 [System.SerializableAttribute()] 19 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))]20 19 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.User))] 21 20 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.LightweightUser))] 21 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))] 22 22 public partial class UserGroupBase : HeuristicLab.Clients.Access.AccessItem { 23 23 … … 55 55 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.ClientLog))] 56 56 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroupBase))] 57 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))]58 57 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.User))] 59 58 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.LightweightUser))] 59 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))] 60 60 public partial class AccessItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { 61 61 … … 671 671 [System.Diagnostics.DebuggerStepThroughAttribute()] 672 672 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 673 [System.Runtime.Serialization.DataContractAttribute(Name = "User", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" + 674 "")] 675 [System.SerializableAttribute()] 676 public partial class User : HeuristicLab.Clients.Access.UserGroupBase { 677 678 [System.Runtime.Serialization.OptionalFieldAttribute()] 679 private string CommentField; 680 681 [System.Runtime.Serialization.OptionalFieldAttribute()] 682 private System.DateTime CreationDateField; 683 684 [System.Runtime.Serialization.OptionalFieldAttribute()] 685 private string EmailField; 686 687 [System.Runtime.Serialization.OptionalFieldAttribute()] 688 private string FullNameField; 689 690 [System.Runtime.Serialization.OptionalFieldAttribute()] 691 private bool IsApprovedField; 692 693 [System.Runtime.Serialization.OptionalFieldAttribute()] 694 private System.DateTime LastActivityDateField; 695 696 [System.Runtime.Serialization.OptionalFieldAttribute()] 697 private System.DateTime LastLoginDateField; 698 699 [System.Runtime.Serialization.OptionalFieldAttribute()] 700 private System.DateTime LastPasswordChangedDateField; 701 702 [System.Runtime.Serialization.OptionalFieldAttribute()] 703 private string UserNameField; 704 705 [System.Runtime.Serialization.DataMemberAttribute()] 706 public string Comment { 707 get { 708 return this.CommentField; 709 } 710 set { 711 if ((object.ReferenceEquals(this.CommentField, value) != true)) { 712 this.CommentField = value; 713 this.RaisePropertyChanged("Comment"); 714 } 715 } 716 } 717 718 [System.Runtime.Serialization.DataMemberAttribute()] 719 public System.DateTime CreationDate { 720 get { 721 return this.CreationDateField; 722 } 723 set { 724 if ((this.CreationDateField.Equals(value) != true)) { 725 this.CreationDateField = value; 726 this.RaisePropertyChanged("CreationDate"); 727 } 728 } 729 } 730 731 [System.Runtime.Serialization.DataMemberAttribute()] 732 public string Email { 733 get { 734 return this.EmailField; 735 } 736 set { 737 if ((object.ReferenceEquals(this.EmailField, value) != true)) { 738 this.EmailField = value; 739 this.RaisePropertyChanged("Email"); 740 } 741 } 742 } 743 744 [System.Runtime.Serialization.DataMemberAttribute()] 745 public string FullName { 746 get { 747 return this.FullNameField; 748 } 749 set { 750 if ((object.ReferenceEquals(this.FullNameField, value) != true)) { 751 this.FullNameField = value; 752 this.RaisePropertyChanged("FullName"); 753 } 754 } 755 } 756 757 [System.Runtime.Serialization.DataMemberAttribute()] 758 public bool IsApproved { 759 get { 760 return this.IsApprovedField; 761 } 762 set { 763 if ((this.IsApprovedField.Equals(value) != true)) { 764 this.IsApprovedField = value; 765 this.RaisePropertyChanged("IsApproved"); 766 } 767 } 768 } 769 770 [System.Runtime.Serialization.DataMemberAttribute()] 771 public System.DateTime LastActivityDate { 772 get { 773 return this.LastActivityDateField; 774 } 775 set { 776 if ((this.LastActivityDateField.Equals(value) != true)) { 777 this.LastActivityDateField = value; 778 this.RaisePropertyChanged("LastActivityDate"); 779 } 780 } 781 } 782 783 [System.Runtime.Serialization.DataMemberAttribute()] 784 public System.DateTime LastLoginDate { 785 get { 786 return this.LastLoginDateField; 787 } 788 set { 789 if ((this.LastLoginDateField.Equals(value) != true)) { 790 this.LastLoginDateField = value; 791 this.RaisePropertyChanged("LastLoginDate"); 792 } 793 } 794 } 795 796 [System.Runtime.Serialization.DataMemberAttribute()] 797 public System.DateTime LastPasswordChangedDate { 798 get { 799 return this.LastPasswordChangedDateField; 800 } 801 set { 802 if ((this.LastPasswordChangedDateField.Equals(value) != true)) { 803 this.LastPasswordChangedDateField = value; 804 this.RaisePropertyChanged("LastPasswordChangedDate"); 805 } 806 } 807 } 808 809 [System.Runtime.Serialization.DataMemberAttribute()] 810 public string UserName { 811 get { 812 return this.UserNameField; 813 } 814 set { 815 if ((object.ReferenceEquals(this.UserNameField, value) != true)) { 816 this.UserNameField = value; 817 this.RaisePropertyChanged("UserName"); 818 } 819 } 820 } 821 } 822 823 [System.Diagnostics.DebuggerStepThroughAttribute()] 824 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 825 [System.Runtime.Serialization.DataContractAttribute(Name = "LightweightUser", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" + 826 "")] 827 [System.SerializableAttribute()] 828 public partial class LightweightUser : HeuristicLab.Clients.Access.UserGroupBase { 829 830 [System.Runtime.Serialization.OptionalFieldAttribute()] 831 private string FullNameField; 832 833 [System.Runtime.Serialization.OptionalFieldAttribute()] 834 private string UserNameField; 835 836 [System.Runtime.Serialization.DataMemberAttribute()] 837 public string FullName { 838 get { 839 return this.FullNameField; 840 } 841 set { 842 if ((object.ReferenceEquals(this.FullNameField, value) != true)) { 843 this.FullNameField = value; 844 this.RaisePropertyChanged("FullName"); 845 } 846 } 847 } 848 849 [System.Runtime.Serialization.DataMemberAttribute()] 850 public string UserName { 851 get { 852 return this.UserNameField; 853 } 854 set { 855 if ((object.ReferenceEquals(this.UserNameField, value) != true)) { 856 this.UserNameField = value; 857 this.RaisePropertyChanged("UserName"); 858 } 859 } 860 } 861 } 862 863 [System.Diagnostics.DebuggerStepThroughAttribute()] 864 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 673 865 [System.Runtime.Serialization.DataContractAttribute(Name = "UserGroup", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" + 674 866 "")] … … 688 880 this.NameField = value; 689 881 this.RaisePropertyChanged("Name"); 690 }691 }692 }693 }694 695 [System.Diagnostics.DebuggerStepThroughAttribute()]696 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]697 [System.Runtime.Serialization.DataContractAttribute(Name = "User", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" +698 "")]699 [System.SerializableAttribute()]700 public partial class User : HeuristicLab.Clients.Access.UserGroupBase {701 702 [System.Runtime.Serialization.OptionalFieldAttribute()]703 private string CommentField;704 705 [System.Runtime.Serialization.OptionalFieldAttribute()]706 private System.DateTime CreationDateField;707 708 [System.Runtime.Serialization.OptionalFieldAttribute()]709 private string EmailField;710 711 [System.Runtime.Serialization.OptionalFieldAttribute()]712 private string FullNameField;713 714 [System.Runtime.Serialization.OptionalFieldAttribute()]715 private bool IsApprovedField;716 717 [System.Runtime.Serialization.OptionalFieldAttribute()]718 private System.DateTime LastActivityDateField;719 720 [System.Runtime.Serialization.OptionalFieldAttribute()]721 private System.DateTime LastLoginDateField;722 723 [System.Runtime.Serialization.OptionalFieldAttribute()]724 private System.DateTime LastPasswordChangedDateField;725 726 [System.Runtime.Serialization.OptionalFieldAttribute()]727 private string UserNameField;728 729 [System.Runtime.Serialization.DataMemberAttribute()]730 public string Comment {731 get {732 return this.CommentField;733 }734 set {735 if ((object.ReferenceEquals(this.CommentField, value) != true)) {736 this.CommentField = value;737 this.RaisePropertyChanged("Comment");738 }739 }740 }741 742 [System.Runtime.Serialization.DataMemberAttribute()]743 public System.DateTime CreationDate {744 get {745 return this.CreationDateField;746 }747 set {748 if ((this.CreationDateField.Equals(value) != true)) {749 this.CreationDateField = value;750 this.RaisePropertyChanged("CreationDate");751 }752 }753 }754 755 [System.Runtime.Serialization.DataMemberAttribute()]756 public string Email {757 get {758 return this.EmailField;759 }760 set {761 if ((object.ReferenceEquals(this.EmailField, value) != true)) {762 this.EmailField = value;763 this.RaisePropertyChanged("Email");764 }765 }766 }767 768 [System.Runtime.Serialization.DataMemberAttribute()]769 public string FullName {770 get {771 return this.FullNameField;772 }773 set {774 if ((object.ReferenceEquals(this.FullNameField, value) != true)) {775 this.FullNameField = value;776 this.RaisePropertyChanged("FullName");777 }778 }779 }780 781 [System.Runtime.Serialization.DataMemberAttribute()]782 public bool IsApproved {783 get {784 return this.IsApprovedField;785 }786 set {787 if ((this.IsApprovedField.Equals(value) != true)) {788 this.IsApprovedField = value;789 this.RaisePropertyChanged("IsApproved");790 }791 }792 }793 794 [System.Runtime.Serialization.DataMemberAttribute()]795 public System.DateTime LastActivityDate {796 get {797 return this.LastActivityDateField;798 }799 set {800 if ((this.LastActivityDateField.Equals(value) != true)) {801 this.LastActivityDateField = value;802 this.RaisePropertyChanged("LastActivityDate");803 }804 }805 }806 807 [System.Runtime.Serialization.DataMemberAttribute()]808 public System.DateTime LastLoginDate {809 get {810 return this.LastLoginDateField;811 }812 set {813 if ((this.LastLoginDateField.Equals(value) != true)) {814 this.LastLoginDateField = value;815 this.RaisePropertyChanged("LastLoginDate");816 }817 }818 }819 820 [System.Runtime.Serialization.DataMemberAttribute()]821 public System.DateTime LastPasswordChangedDate {822 get {823 return this.LastPasswordChangedDateField;824 }825 set {826 if ((this.LastPasswordChangedDateField.Equals(value) != true)) {827 this.LastPasswordChangedDateField = value;828 this.RaisePropertyChanged("LastPasswordChangedDate");829 }830 }831 }832 833 [System.Runtime.Serialization.DataMemberAttribute()]834 public string UserName {835 get {836 return this.UserNameField;837 }838 set {839 if ((object.ReferenceEquals(this.UserNameField, value) != true)) {840 this.UserNameField = value;841 this.RaisePropertyChanged("UserName");842 }843 }844 }845 }846 847 [System.Diagnostics.DebuggerStepThroughAttribute()]848 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]849 [System.Runtime.Serialization.DataContractAttribute(Name = "LightweightUser", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" +850 "")]851 [System.SerializableAttribute()]852 public partial class LightweightUser : HeuristicLab.Clients.Access.UserGroupBase {853 854 [System.Runtime.Serialization.OptionalFieldAttribute()]855 private string FullNameField;856 857 [System.Runtime.Serialization.OptionalFieldAttribute()]858 private string UserNameField;859 860 [System.Runtime.Serialization.DataMemberAttribute()]861 public string FullName {862 get {863 return this.FullNameField;864 }865 set {866 if ((object.ReferenceEquals(this.FullNameField, value) != true)) {867 this.FullNameField = value;868 this.RaisePropertyChanged("FullName");869 }870 }871 }872 873 [System.Runtime.Serialization.DataMemberAttribute()]874 public string UserName {875 get {876 return this.UserNameField;877 }878 set {879 if ((object.ReferenceEquals(this.UserNameField, value) != true)) {880 this.UserNameField = value;881 this.RaisePropertyChanged("UserName");882 882 } 883 883 } … … 1011 1011 public interface IAccessService { 1012 1012 1013 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetUsersAndGroups", ReplyAction = "http://tempuri.org/IAccessService/GetUsersAndGroupsResponse")] 1014 System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetUsersAndGroups(); 1015 1016 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetAllLeightweightUsersAndGroups", ReplyAction = "http://tempuri.org/IAccessService/GetAllLeightweightUsersAndGroupsResponse")] 1017 System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetAllLeightweightUsersAndGroups(); 1018 1013 1019 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetLeightweightUsersAndGroups", ReplyAction = "http://tempuri.org/IAccessService/GetLeightweightUsersAndGroupsResponse")] 1014 1020 System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetLeightweightUsersAndGroups(System.Collections.Generic.List<System.Guid> ids); … … 1111 1117 1112 1118 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/Login", ReplyAction = "http://tempuri.org/IAccessService/LoginResponse")] 1113 HeuristicLab.Clients.Access.User Login(); 1119 HeuristicLab.Clients.Access.LightweightUser Login(); 1120 1121 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetGroupsOfCurrentUser", ReplyAction = "http://tempuri.org/IAccessService/GetGroupsOfCurrentUserResponse")] 1122 System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroup> GetGroupsOfCurrentUser(); 1123 1124 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetRolesOfCurrentUser", ReplyAction = "http://tempuri.org/IAccessService/GetRolesOfCurrentUserResponse")] 1125 System.Collections.Generic.List<HeuristicLab.Clients.Access.Role> GetRolesOfCurrentUser(); 1114 1126 1115 1127 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetAllLightweightUsers", ReplyAction = "http://tempuri.org/IAccessService/GetAllLightweightUsersResponse")] … … 1166 1178 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/RemoveUserGroupBaseFromGroup", ReplyAction = "http://tempuri.org/IAccessService/RemoveUserGroupBaseFromGroupResponse")] 1167 1179 void RemoveUserGroupBaseFromGroup(HeuristicLab.Clients.Access.UserGroupBase resource, HeuristicLab.Clients.Access.UserGroup group); 1168 1169 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetUsersAndGroups", ReplyAction = "http://tempuri.org/IAccessService/GetUsersAndGroupsResponse")]1170 System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetUsersAndGroups();1171 1172 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetAllLeightweightUsersAndGroups", ReplyAction = "http://tempuri.org/IAccessService/GetAllLeightweightUsersAndGroupsResponse")]1173 System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetAllLeightweightUsersAndGroups();1174 1180 } 1175 1181 … … 1201 1207 } 1202 1208 1209 public System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetUsersAndGroups() { 1210 return base.Channel.GetUsersAndGroups(); 1211 } 1212 1213 public System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetAllLeightweightUsersAndGroups() { 1214 return base.Channel.GetAllLeightweightUsersAndGroups(); 1215 } 1216 1203 1217 public System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetLeightweightUsersAndGroups(System.Collections.Generic.List<System.Guid> ids) { 1204 1218 return base.Channel.GetLeightweightUsersAndGroups(ids); … … 1333 1347 } 1334 1348 1335 public HeuristicLab.Clients.Access. User Login() {1349 public HeuristicLab.Clients.Access.LightweightUser Login() { 1336 1350 return base.Channel.Login(); 1351 } 1352 1353 public System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroup> GetGroupsOfCurrentUser() { 1354 return base.Channel.GetGroupsOfCurrentUser(); 1355 } 1356 1357 public System.Collections.Generic.List<HeuristicLab.Clients.Access.Role> GetRolesOfCurrentUser() { 1358 return base.Channel.GetRolesOfCurrentUser(); 1337 1359 } 1338 1360 … … 1408 1430 base.Channel.RemoveUserGroupBaseFromGroup(resource, group); 1409 1431 } 1410 1411 public System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetUsersAndGroups() {1412 return base.Channel.GetUsersAndGroups();1413 }1414 1415 public System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetAllLeightweightUsersAndGroups() {1416 return base.Channel.GetAllLeightweightUsersAndGroups();1417 }1418 1432 } 1419 1433 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ServiceClients/LightweightUser.cs
r7426 r7436 33 33 } 34 34 35 public static Image StaticItemImage {35 public static new Image StaticItemImage { 36 36 get { return HeuristicLab.Common.Resources.VSImageLibrary.User; } 37 37 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ServiceClients/UserGroup.cs
r7426 r7436 31 31 } 32 32 33 public static Image StaticItemImage {33 public static new Image StaticItemImage { 34 34 get { return HeuristicLab.Common.Resources.VSImageLibrary.UserAccounts; } 35 35 } -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/AccessService.cs
r7426 r7436 359 359 } 360 360 361 public DT. User Login() {361 public DT.LightweightUser Login() { 362 362 Guid userId = UserManager.CurrentUserId; 363 return BuildUserDto(userId); 364 } 363 return BuildLightweightUserDto(userId); 364 } 365 366 public IEnumerable<DT.UserGroup> GetGroupsOfCurrentUser() { 367 Guid userId = UserManager.CurrentUserId; 368 369 using (DA.ClientManagementDataContext context = new DA.ClientManagementDataContext()) { 370 //TODO: this has to be done recursive, so check if a group is in another 371 //group because then the user is also in this group... 372 var query = from g in context.UserGroupUserGroups 373 from ug in context.UserGroupBases.OfType<DA.UserGroup>() 374 where g.UserGroupId == userId && g.UserGroupUserGroupId == ug.Id 375 select Convert.ToDto(ug); 376 return query.ToList(); 377 } 378 } 379 380 public IEnumerable<DT.Role> GetRolesOfCurrentUser() { 381 Guid userId = UserManager.CurrentUserId; 382 383 using (DA.ASPNETAuthenticationDataContext context = new DA.ASPNETAuthenticationDataContext()) { 384 var query = from ur in context.aspnet_UsersInRoles 385 from r in context.aspnet_Roles 386 where ur.UserId == userId && ur.RoleId == r.RoleId 387 select Convert.ToDto(r); 388 return query.ToList(); 389 } 390 } 391 365 392 366 393 public IEnumerable<DT.LightweightUser> GetAllLightweightUsers() { -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/IAccessService.cs
r7426 r7436 106 106 //TODO: i don't think this method is needed 107 107 [OperationContract] 108 User Login(); 108 LightweightUser Login(); 109 110 [OperationContract] 111 IEnumerable<UserGroup> GetGroupsOfCurrentUser(); 112 113 [OperationContract] 114 IEnumerable<Role> GetRolesOfCurrentUser(); 109 115 110 116 [OperationContract]
Note: See TracChangeset
for help on using the changeset viewer.