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

Last change on this file since 328 was 325, checked in by alloc, 6 years ago

Code style cleanup (mostly whitespace changes, enforcing braces, using cleanup)

File size: 780 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
[325]16 public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
17 int permissionLevel);
18
[244]19 public bool IsAuthorizedForHandler (WebConnection user, int permissionLevel) {
20 if (moduleName != null) {
21 return WebPermissions.Instance.ModuleAllowedWithLevel (moduleName, permissionLevel);
22 }
[325]23
24 return true;
[244]25 }
[230]26 }
[325]27}
Note: See TracBrowser for help on using the repository browser.