- Timestamp:
- Aug 6, 2022, 11:32:32 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/MapRendering/Web/Handlers/UserStatusHandler.cs
r382 r387 1 1 using AllocsFixes.JSON; 2 using AllocsFixes.NetConnections.Servers.Web.API;3 using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest;4 using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse;5 2 6 3 namespace AllocsFixes.NetConnections.Servers.Web.Handlers { … … 9 6 } 10 7 11 public override void HandleRequest (string _requestPath, HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _con, 12 int _permissionLevel) { 8 public override void HandleRequest (RequestContext _context) { 13 9 JSONObject result = new JSONObject (); 14 10 15 result.Add ("loggedin", new JSONBoolean (_con != null));16 result.Add ("username", new JSONString (_con != null ? _con.UserId.ToString () : string.Empty));11 result.Add ("loggedin", new JSONBoolean (_context.Connection != null)); 12 result.Add ("username", new JSONString (_context.Connection != null ? _context.Connection.UserId.ToString () : string.Empty)); 17 13 18 14 JSONArray perms = new JSONArray (); … … 20 16 JSONObject permObj = new JSONObject (); 21 17 permObj.Add ("module", new JSONString (perm.module)); 22 permObj.Add ("allowed", new JSONBoolean (perm.permissionLevel >= _ permissionLevel));18 permObj.Add ("allowed", new JSONBoolean (perm.permissionLevel >= _context.PermissionLevel)); 23 19 perms.Add (permObj); 24 20 } … … 26 22 result.Add ("permissions", perms); 27 23 28 Web API.WriteJSON (_resp, result);24 WebUtils.WriteJson (_context.Response, result); 29 25 } 30 26 }
Note:
See TracChangeset
for help on using the changeset viewer.