Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2020


Ignore:
Timestamp:
06/04/09 23:01:50 (15 years ago)
Author:
svonolfe
Message:

Added GetUserByLogin method for the SecurityManager (#532)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Security.Contracts/3.2/Interfaces/ISecurityManager.cs

    r1738 r2020  
    4141    [FaultContractAttribute(typeof(CommunicationException))]
    4242    User GetUserByName(string name);
     43
     44    [OperationContract]
     45    [FaultContractAttribute(typeof(CommunicationException))]
     46    User GetUserByLogin(string login);
    4347
    4448    [OperationContract]
  • trunk/sources/HeuristicLab.Security.Core/3.2/SecurityManager.cs

    r1738 r2020  
    120120
    121121    /// <summary>
     122    /// Gets user by his login.
     123    /// </summary>
     124    /// <param name="login"></param>
     125    /// <returns></returns>
     126    public User GetUserByLogin(string login) {
     127      try {
     128        session = factory.GetSessionForCurrentThread();
     129        IUserAdapter userAdapter = session.GetDataAdapter<User, IUserAdapter>();
     130
     131        return userAdapter.GetByLogin(login);
     132      }
     133      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
     134      finally {
     135        if (session != null)
     136          session.EndSession();
     137      }
     138    }
     139
     140    /// <summary>
    122141    /// Add new user group.
    123142    /// </summary>
Note: See TracChangeset for help on using the changeset viewer.