private void GetUser(HttpEntityManager http, UriTemplateMatch match) { if (_httpForwarder.ForwardRequest(http)) { return; } var envelope = CreateReplyEnvelope <UserManagementMessage.UserDetailsResult>(http); var login = match.BoundVariables["login"]; var message = new UserManagementMessage.Get(envelope, http.User, login); Publish(message); }
private void GetUser(HttpEntityManager http, UriTemplateMatch match) { if (_httpForwarder.ForwardRequest(http)) { return; } var envelope = CreateSendToHttpWithConversionEnvelope(http, (UserManagementMessage.UserDetailsResult msg) => new UserManagementMessage.UserDetailsResultHttpFormatted(msg, s => MakeUrl(http, s))); var login = match.BoundVariables["login"]; var message = new UserManagementMessage.Get(envelope, http.User, login); Publish(message); }
private void GetCurrentUser(HttpEntityManager http, UriTemplateMatch match) { if (_httpForwarder.ForwardRequest(http)) { return; } var envelope = CreateReplyEnvelope <UserManagementMessage.UserDetailsResult>(http); if (http.User == null) { envelope.ReplyWith( new UserManagementMessage.UserDetailsResult(UserManagementMessage.Error.Unauthorized)); return; } var message = new UserManagementMessage.Get(envelope, http.User, http.User.Identity.Name); Publish(message); }