Changeset 7436


Ignore:
Timestamp:
01/31/12 22:54:22 (9 years ago)
Author:
ascheibe
Message:

#1648 started working on a class which should store all user information on the client side

Location:
branches/ClientUserManagement
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/AccessClient.cs

    r7426 r7436  
    108108
    109109    #region Helpers
    110     private static void CallRunCreationService(Action<IAccessService> call) {
     110    public static void CallRunCreationService(Action<IAccessService> call) {
    111111      AccessServiceClient client = ClientFactory.CreateClient<AccessServiceClient, IAccessService>();
    112112      try {
     
    122122      }
    123123    }
    124     private static T CallRunCreationService<T>(Func<IAccessService, T> call) {
     124    public static T CallRunCreationService<T>(Func<IAccessService, T> call) {
    125125      AccessServiceClient client = ClientFactory.CreateClient<AccessServiceClient, IAccessService>();
    126126      try {
  • branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/HeuristicLab.Clients.Access-3.3.csproj

    r7426 r7436  
    104104    <Compile Include="ServiceClients\UserGroup.cs" />
    105105    <Compile Include="ServiceClients\UserGroupBase.cs" />
     106    <Compile Include="UserInformation.cs" />
    106107    <Compile Include="Views\LightweightUserGroupSelectionDialog.cs">
    107108      <SubType>Form</SubType>
  • branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ServiceClients/AccessServiceClient.cs

    r7426 r7436  
    1717      "")]
    1818  [System.SerializableAttribute()]
    19   [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))]
    2019  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.User))]
    2120  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.LightweightUser))]
     21  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))]
    2222  public partial class UserGroupBase : HeuristicLab.Clients.Access.AccessItem {
    2323
     
    5555  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.ClientLog))]
    5656  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroupBase))]
    57   [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))]
    5857  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.User))]
    5958  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.LightweightUser))]
     59  [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Access.UserGroup))]
    6060  public partial class AccessItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
    6161
     
    671671  [System.Diagnostics.DebuggerStepThroughAttribute()]
    672672  [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")]
    673865  [System.Runtime.Serialization.DataContractAttribute(Name = "UserGroup", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Access.DataTransfer" +
    674866      "")]
     
    688880          this.NameField = value;
    689881          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");
    882882        }
    883883      }
     
    10111011  public interface IAccessService {
    10121012
     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
    10131019    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetLeightweightUsersAndGroups", ReplyAction = "http://tempuri.org/IAccessService/GetLeightweightUsersAndGroupsResponse")]
    10141020    System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetLeightweightUsersAndGroups(System.Collections.Generic.List<System.Guid> ids);
     
    11111117
    11121118    [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();
    11141126
    11151127    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/GetAllLightweightUsers", ReplyAction = "http://tempuri.org/IAccessService/GetAllLightweightUsersResponse")]
     
    11661178    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IAccessService/RemoveUserGroupBaseFromGroup", ReplyAction = "http://tempuri.org/IAccessService/RemoveUserGroupBaseFromGroupResponse")]
    11671179    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();
    11741180  }
    11751181
     
    12011207    }
    12021208
     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
    12031217    public System.Collections.Generic.List<HeuristicLab.Clients.Access.UserGroupBase> GetLeightweightUsersAndGroups(System.Collections.Generic.List<System.Guid> ids) {
    12041218      return base.Channel.GetLeightweightUsersAndGroups(ids);
     
    13331347    }
    13341348
    1335     public HeuristicLab.Clients.Access.User Login() {
     1349    public HeuristicLab.Clients.Access.LightweightUser Login() {
    13361350      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();
    13371359    }
    13381360
     
    14081430      base.Channel.RemoveUserGroupBaseFromGroup(resource, group);
    14091431    }
    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     }
    14181432  }
    14191433}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ServiceClients/LightweightUser.cs

    r7426 r7436  
    3333    }
    3434
    35     public static Image StaticItemImage {
     35    public static new Image StaticItemImage {
    3636      get { return HeuristicLab.Common.Resources.VSImageLibrary.User; }
    3737    }
  • branches/ClientUserManagement/HeuristicLab.Clients.Access/3.3/ServiceClients/UserGroup.cs

    r7426 r7436  
    3131    }
    3232
    33     public static Image StaticItemImage {
     33    public static new Image StaticItemImage {
    3434      get { return HeuristicLab.Common.Resources.VSImageLibrary.UserAccounts; }
    3535    }
  • branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/AccessService.cs

    r7426 r7436  
    359359    }
    360360
    361     public DT.User Login() {
     361    public DT.LightweightUser Login() {
    362362      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
    365392
    366393    public IEnumerable<DT.LightweightUser> GetAllLightweightUsers() {
  • branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/IAccessService.cs

    r7426 r7436  
    106106    //TODO: i don't think this method is needed
    107107    [OperationContract]
    108     User Login();
     108    LightweightUser Login();
     109
     110    [OperationContract]
     111    IEnumerable<UserGroup> GetGroupsOfCurrentUser();
     112
     113    [OperationContract]
     114    IEnumerable<Role> GetRolesOfCurrentUser();
    109115
    110116    [OperationContract]
Note: See TracChangeset for help on using the changeset viewer.