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