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()));
        }
Esempio n. 2
0
        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()));
        }