source: binary-improvements2/MapRendering/Web/Handlers/AbsHandler.cs@ 385

Last change on this file since 385 was 383, checked in by alloc, 3 years ago

Fixed a bunch of warnings

File size: 1.2 KB
RevLine 
[382]1using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest;
2using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse;
[230]3
[325]4namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
[382]5 public abstract class AbsHandler {
[367]6 protected readonly string moduleName;
7 protected string urlBasePath;
8 protected Web parent;
[244]9
[382]10 public string ModuleName => moduleName;
11 public string UrlBasePath => urlBasePath;
12
13 protected AbsHandler (string _moduleName, int _defaultPermissionLevel = 0) {
[325]14 moduleName = _moduleName;
[279]15 WebPermissions.Instance.AddKnownModule (_moduleName, _defaultPermissionLevel);
[244]16 }
17
[382]18 public abstract void HandleRequest (string _requestPath, HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _con,
[351]19 int _permissionLevel);
[325]20
[372]21 public virtual bool IsAuthorizedForHandler (WebConnection _user, int _permissionLevel) {
22 return moduleName == null || WebPermissions.Instance.ModuleAllowedWithLevel (moduleName, _permissionLevel);
[244]23 }
[367]24
25 public virtual void Shutdown () {
26 }
27
28 public virtual void SetBasePathAndParent (Web _parent, string _relativePath) {
29 parent = _parent;
30 urlBasePath = _relativePath;
31 }
[230]32 }
[325]33}
Note: See TracBrowser for help on using the repository browser.