Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12932


Ignore:
Timestamp:
09/02/15 14:28:46 (9 years ago)
Author:
ascheibe
Message:

#2388 fixed problem with not existing users when downloading shared jobs

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Services.Access/3.3/Interfaces/IUserManager.cs

    r12012 r12932  
    3030    MembershipUser GetUserByName(string username);
    3131    MembershipUser GetUserById(Guid userId);
     32    string GetUserNameById(Guid userId);
    3233    bool VerifyUser(Guid userId, List<Guid> allowedUserGroups);
    3334  }
  • trunk/sources/HeuristicLab.Services.Access/3.3/UserManager.cs

    r12012 r12932  
    4242    public MembershipUser GetUserById(Guid userId) {
    4343      return Membership.GetUser(userId);
     44    }
     45
     46    public string GetUserNameById(Guid userId) {
     47      var user = GetUserById(userId);
     48      if (user != null) {
     49        return user.UserName;
     50      } else {
     51        return userId.ToString();
     52      }
     53
    4454    }
    4555
  • trunk/sources/HeuristicLab.Services.Hive/3.3/HiveService.cs

    r12926 r12932  
    311311              job.FinishedCount = statistics.FinishedCount;
    312312            }
    313             job.OwnerUsername = UserManager.GetUserById(job.OwnerUserId).UserName;
     313            job.OwnerUsername = UserManager.GetUserNameById(job.OwnerUserId);
    314314            if (currentUserId == job.OwnerUserId) {
    315315              job.Permission = Permission.Full;
     
    355355              job.FinishedCount = statistic.FinishedCount;
    356356            }
    357             job.OwnerUsername = UserManager.GetUserById(job.OwnerUserId).UserName;
     357            job.OwnerUsername = UserManager.GetUserNameById(job.OwnerUserId);
    358358            if (currentUserId == job.OwnerUserId) {
    359359              job.Permission = Permission.Full;
  • trunk/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApi/DataController.cs

    r12913 r12932  
    6262          User = new DT.User {
    6363            Id = uts.UserId.ToString(),
    64             Name = ServiceLocator.Instance.UserManager.GetUserById(uts.UserId).UserName
     64            Name = ServiceLocator.Instance.UserManager.GetUserNameById(uts.UserId)
    6565          },
    6666          CalculatingTasks = uts.CalculatingTasks,
Note: See TracChangeset for help on using the changeset viewer.