Ignore:
Timestamp:
Jul 21, 2015, 9:51:32 PM (9 years ago)
Author:
alloc
Message:

Fixes intermediate state

Location:
binary-improvements/MapRendering/Web/Handlers
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • binary-improvements/MapRendering/Web/Handlers/PathHandler.cs

    r230 r244  
    22using System.Net;
    33
    4 namespace AllocsFixes.NetConnections.Servers.Web
     4namespace AllocsFixes.NetConnections.Servers.Web.Handlers
    55{
    66        public abstract class PathHandler
    77        {
    8                 public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, HttpListenerBasicIdentity user);
     8                private string moduleName = null;
     9                public string ModuleName {
     10                        get { return moduleName; }
     11                }
     12
     13                protected PathHandler (string _moduleName) {
     14                        this.moduleName = _moduleName;
     15                        WebPermissions.Instance.AddKnownModule (_moduleName);
     16                }
     17
     18                public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel);
     19
     20                public bool IsAuthorizedForHandler (WebConnection user, int permissionLevel) {
     21                        if (moduleName != null) {
     22                                return WebPermissions.Instance.ModuleAllowedWithLevel (moduleName, permissionLevel);
     23                        } else {
     24                                return true;
     25                        }
     26                }
    927        }
    1028}
Note: See TracChangeset for help on using the changeset viewer.