Last change
on this file since 325 was 325, checked in by alloc, 6 years ago |
Code style cleanup (mostly whitespace changes, enforcing braces, using cleanup)
|
File size:
780 bytes
|
Line | |
---|
1 | using System.Net;
|
---|
2 |
|
---|
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 |
|
---|
12 | public string ModuleName {
|
---|
13 | get { return moduleName; }
|
---|
14 | }
|
---|
15 |
|
---|
16 | public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
|
---|
17 | int permissionLevel);
|
---|
18 |
|
---|
19 | public bool IsAuthorizedForHandler (WebConnection user, int permissionLevel) {
|
---|
20 | if (moduleName != null) {
|
---|
21 | return WebPermissions.Instance.ModuleAllowedWithLevel (moduleName, permissionLevel);
|
---|
22 | }
|
---|
23 |
|
---|
24 | return true;
|
---|
25 | }
|
---|
26 | }
|
---|
27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.