- Timestamp:
- Feb 16, 2023, 3:50:53 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/Commands/WebPermissionsCmd.cs
r391 r404 1 1 using System.Collections.Generic; 2 2 using JetBrains.Annotations; 3 using Webserver.Permissions; 3 4 4 5 namespace Webserver.Commands { … … 44 45 } 45 46 46 if (! WebPermissions.Instance.IsKnownModule (_params [1])) {47 if (!AdminWebModules.Instance.IsKnownModule (_params [1])) { 47 48 SdtdConsole.Instance.Output ($"\"{_params [1]}\" is not a valid web function."); 48 49 return; … … 54 55 } 55 56 56 WebPermissions.Instance.AddModulePermission(_params [1], level);57 AdminWebModules.Instance.AddModule (_params [1], level); 57 58 SdtdConsole.Instance.Output ($"{_params [1]} added with permission level of {level}."); 58 59 } … … 64 65 } 65 66 66 if (! WebPermissions.Instance.IsKnownModule (_params [1])) {67 if (!AdminWebModules.Instance.IsKnownModule (_params [1])) { 67 68 SdtdConsole.Instance.Output ($"\"{_params [1]}\" is not a valid web function."); 68 69 return; 69 70 } 70 71 71 WebPermissions.Instance.RemoveModulePermission(_params [1]);72 AdminWebModules.Instance.RemoveModule (_params [1]); 72 73 SdtdConsole.Instance.Output ($"{_params [1]} removed from permissions list."); 73 74 } … … 76 77 SdtdConsole.Instance.Output ("Defined web function permissions:"); 77 78 SdtdConsole.Instance.Output (" Level: Web function"); 78 foreach (WebPermissions.WebModulePermission wmp in WebPermissions.Instance.GetModules ()) { 79 SdtdConsole.Instance.Output ($" {wmp.permissionLevel,5}: {wmp.module}"); 79 80 List<AdminWebModules.WebModule> wmps = AdminWebModules.Instance.GetModules (); 81 for (int i = 0; i < wmps.Count; i++) { 82 AdminWebModules.WebModule wmp = wmps [i]; 83 84 SdtdConsole.Instance.Output ($" {wmp.PermissionLevel,5}: {wmp.Name}"); 80 85 } 81 86 }
Note:
See TracChangeset
for help on using the changeset viewer.