- Timestamp:
- Sep 4, 2018, 1:00:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/Handlers/PathHandler.cs
r279 r325 1 using System;2 1 using System.Net; 3 2 4 namespace AllocsFixes.NetConnections.Servers.Web.Handlers 5 { 6 public abstract class PathHandler 7 { 8 private string moduleName = null; 3 namespace AllocsFixes.NetConnections.Servers.Web.Handlers { 4 public abstract class PathHandler { 5 private readonly string moduleName; 6 7 protected PathHandler (string _moduleName, int _defaultPermissionLevel = 0) { 8 moduleName = _moduleName; 9 WebPermissions.Instance.AddKnownModule (_moduleName, _defaultPermissionLevel); 10 } 11 9 12 public string ModuleName { 10 13 get { return moduleName; } 11 14 } 12 15 13 protected PathHandler (string _moduleName, int _defaultPermissionLevel = 0) { 14 this.moduleName = _moduleName; 15 WebPermissions.Instance.AddKnownModule (_moduleName, _defaultPermissionLevel); 16 } 17 18 public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel); 16 public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, 17 int permissionLevel); 19 18 20 19 public bool IsAuthorizedForHandler (WebConnection user, int permissionLevel) { 21 20 if (moduleName != null) { 22 21 return WebPermissions.Instance.ModuleAllowedWithLevel (moduleName, permissionLevel); 23 } else {24 return true;25 22 } 23 24 return true; 26 25 } 27 26 } 28 27 } 29
Note:
See TracChangeset
for help on using the changeset viewer.