source: binary-improvements/MapRendering/Web/Handlers/PathHandler.cs@ 364

Last change on this file since 364 was 351, checked in by alloc, 6 years ago

Fixed game version compatibility of GamePrefs
Code style cleanup (mostly argument names)

File size: 787 bytes
RevLine 
[230]1using System.Net;
2
[325]3namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
4 public abstract class PathHandler {
5 private readonly string moduleName;
[244]6
[279]7 protected PathHandler (string _moduleName, int _defaultPermissionLevel = 0) {
[325]8 moduleName = _moduleName;
[279]9 WebPermissions.Instance.AddKnownModule (_moduleName, _defaultPermissionLevel);
[244]10 }
11
[325]12 public string ModuleName {
13 get { return moduleName; }
14 }
[244]15
[351]16 public abstract void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,
17 int _permissionLevel);
[325]18
[351]19 public bool IsAuthorizedForHandler (WebConnection _user, int _permissionLevel) {
[244]20 if (moduleName != null) {
[351]21 return WebPermissions.Instance.ModuleAllowedWithLevel (moduleName, _permissionLevel);
[244]22 }
[325]23
24 return true;
[244]25 }
[230]26 }
[325]27}
Note: See TracBrowser for help on using the repository browser.