public ListUserSessionsResponse ListUserSessions(ListUserSessionsRequest request) { Platform.CheckForNullReference(request, "request"); Platform.CheckMemberIsSet(request.UserName, "UserName"); var user = FindUserByName(request.UserName); var assembler = new UserAssembler(); return(new ListUserSessionsResponse(user.UserName, user.ActiveSessions.Select(assembler.GetUserSessionSummary).ToList())); }
public ListUserSessionsResponse ListUserSessions(ListUserSessionsRequest request) { Platform.CheckForNullReference(request, "request"); Platform.CheckMemberIsSet(request.UserName, "UserName"); var user = FindUserByName(request.UserName); EnsureCurrentUserAuthorizedToManage(user.AccountType); var assembler = new UserAssembler(); var sessions = user.ActiveSessions.Where(s => !s.IsImpersonated); return(new ListUserSessionsResponse(user.UserName, sessions.Select(assembler.GetUserSessionSummary).ToList())); }