- Timestamp:
- Feb 27, 2023, 9:40:43 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/Commands/WebPermissionsCmd.cs
r405 r419 20 20 " webpermission add <webfunction> <level>\n" + 21 21 " webpermission remove <webfunction>\n" + 22 " webpermission list ";22 " webpermission list [includedefaults]"; 23 23 } 24 24 … … 30 30 ExecuteRemove (_params); 31 31 } else if (_params [0].EqualsCaseInsensitive ("list")) { 32 ExecuteList ( );32 ExecuteList (_params); 33 33 } else { 34 34 SdtdConsole.Instance.Output ($"Invalid sub command \"{_params [0]}\"."); … … 74 74 } 75 75 76 private void ExecuteList () { 76 private void ExecuteList (List<string> _params) { 77 bool includeDefaults = _params.Count > 1 && ConsoleHelper.ParseParamBool (_params [1], true); 78 77 79 SdtdConsole.Instance.Output ("Defined web function permissions:"); 78 80 SdtdConsole.Instance.Output (" Level: Web function"); … … 81 83 for (int i = 0; i < wmps.Count; i++) { 82 84 AdminWebModules.WebModule wmp = wmps [i]; 83 84 SdtdConsole.Instance.Output ($" {wmp.PermissionLevel,5}: {wmp.Name}"); 85 86 if (!includeDefaults && wmp.IsDefault) { 87 continue; 88 } 89 90 if (wmp.IsDefault) { 91 if (wmp.PermissionLevel == int.MinValue) { 92 SdtdConsole.Instance.Output ($" - : {wmp.Name} (default permission)"); 93 } else { 94 SdtdConsole.Instance.Output ($" {wmp.PermissionLevel,5}: {wmp.Name} (default permission)"); 95 } 96 } else { 97 SdtdConsole.Instance.Output ($" {wmp.PermissionLevel,5}: {wmp.Name}"); 98 } 85 99 } 86 100 }
Note:
See TracChangeset
for help on using the changeset viewer.