Rev | Line | |
---|
[230] | 1 | using System;
|
---|
| 2 | using System.Net;
|
---|
| 3 |
|
---|
[244] | 4 | namespace AllocsFixes.NetConnections.Servers.Web.Handlers
|
---|
[230] | 5 | {
|
---|
| 6 | public abstract class PathHandler
|
---|
| 7 | {
|
---|
[244] | 8 | private string moduleName = null;
|
---|
| 9 | public string ModuleName {
|
---|
| 10 | get { return moduleName; }
|
---|
| 11 | }
|
---|
| 12 |
|
---|
[279] | 13 | protected PathHandler (string _moduleName, int _defaultPermissionLevel = 0) {
|
---|
[244] | 14 | this.moduleName = _moduleName;
|
---|
[279] | 15 | WebPermissions.Instance.AddKnownModule (_moduleName, _defaultPermissionLevel);
|
---|
[244] | 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 | }
|
---|
[230] | 27 | }
|
---|
| 28 | }
|
---|
| 29 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.