diff --git a/LiamWorkflowDiagnostics/MainWindow.xaml b/LiamWorkflowDiagnostics/MainWindow.xaml
index 0e48be8..8b403b5 100644
--- a/LiamWorkflowDiagnostics/MainWindow.xaml
+++ b/LiamWorkflowDiagnostics/MainWindow.xaml
@@ -283,6 +283,7 @@
+
@@ -299,7 +300,8 @@
-
+
+
diff --git a/LiamWorkflowDiagnostics/MainWindow.xaml.cs b/LiamWorkflowDiagnostics/MainWindow.xaml.cs
index 1dfb6f3..165aa52 100644
--- a/LiamWorkflowDiagnostics/MainWindow.xaml.cs
+++ b/LiamWorkflowDiagnostics/MainWindow.xaml.cs
@@ -584,7 +584,7 @@ namespace LiamWorkflowDiagnostics
if (runWhatIf && result.AutomaticEnsurePreview != null && result.AutomaticEnsurePreview.Count > 0)
{
- AppendLog($"EnsureNtfsPermissionGroups wurde nur simuliert fuer {result.AutomaticEnsurePreview.Count} Ordner. Details stehen im Result-JSON.", LogLevels.Warning);
+ AppendLog($"Automatisches NTFS-Ensure wurde nur simuliert fuer {result.AutomaticEnsurePreview.Count} DataAreas. Details stehen im Result-JSON.", LogLevels.Warning);
}
AppendLog($"DataAreas erhalten: {result.DataAreas.Count}");
@@ -617,35 +617,21 @@ namespace LiamWorkflowDiagnostics
await ExecuteProviderActionAsync("NTFS Folder Create", async () =>
{
- var result = await Task.Run(() => LiamWorkflowRuntime.CreateDataAreaAsync(
- provider,
- folderPath,
- parentPath,
- null,
- ownerSids,
- readerSids,
- writerSids));
+ var result = await RunWithWorkflowWhatIfAsync(provider, () => Task.Run(() => LiamWorkflowRuntime.CreateDataAreaAsync(
+ provider,
+ folderPath,
+ parentPath,
+ null,
+ ownerSids,
+ readerSids,
+ writerSids)));
return new
{
result.Success,
ResultToken = MapResultToken(result.ResultToken)
};
- }, () =>
- {
- return CreateWhatIfResult(
- "NTFS Folder Create",
- "Wuerde einen Ordner anlegen und fehlende Gruppen sowie ACLs sicherstellen. Es wurden keine Aenderungen ausgefuehrt.",
- new
- {
- ProviderRootPath = provider.RootPath,
- NewFolderPath = folderPath,
- ParentFolderPath = parentPath,
- OwnerSids = ownerSids,
- ReaderSids = readerSids,
- WriterSids = writerSids
- });
- });
+ }, actionHandlesWhatIf: true);
}
catch (Exception ex)
{
@@ -667,35 +653,21 @@ namespace LiamWorkflowDiagnostics
await ExecuteProviderActionAsync("NTFS Ensure Groups / ACLs", async () =>
{
- var result = await Task.Run(() => LiamWorkflowRuntime.EnsureNtfsPermissionGroupsAsync(
- provider,
- folderPath,
- null,
- ownerSids,
- readerSids,
- writerSids,
- ensureTraverse));
+ var result = await RunWithWorkflowWhatIfAsync(provider, () => Task.Run(() => LiamWorkflowRuntime.EnsureNtfsPermissionGroupsAsync(
+ provider,
+ folderPath,
+ null,
+ ownerSids,
+ readerSids,
+ writerSids,
+ ensureTraverse)));
return new
{
result.Success,
ResultToken = MapResultToken(result.ResultToken)
};
- }, () =>
- {
- return CreateWhatIfResult(
- "NTFS Ensure Groups / ACLs",
- "Wuerde fehlende NTFS-Berechtigungsgruppen und ACLs additiv sicherstellen. Es wurden keine Aenderungen ausgefuehrt.",
- new
- {
- ProviderRootPath = provider.RootPath,
- FolderPath = folderPath,
- OwnerSids = ownerSids,
- ReaderSids = readerSids,
- WriterSids = writerSids,
- EnsureTraverseGroups = ensureTraverse
- });
- });
+ }, actionHandlesWhatIf: true);
}
catch (Exception ex)
{
@@ -704,6 +676,34 @@ namespace LiamWorkflowDiagnostics
}
}
+ private async void ExecuteNtfsTraverseOnlyButton_Click(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ var provider = EnsureInitializedProvider("NTFS");
+ var folderPath = GetRequiredText(NtfsEnsureFolderPathTextBox.Text, "Folder Path");
+
+ await ExecuteProviderActionAsync("NTFS Ensure Traverse Only", async () =>
+ {
+ var token = await Task.Run(() => provider.EnsureTraverseGroupsAsync(
+ folderPath,
+ null,
+ IsWhatIfEnabled));
+
+ return new
+ {
+ Success = token != null && token.resultErrorId == 0,
+ ResultToken = MapResultToken(token)
+ };
+ }, actionHandlesWhatIf: true);
+ }
+ catch (Exception ex)
+ {
+ AppendLog($"NTFS Ensure Traverse Only fehlgeschlagen: {ex.Message}", LogLevels.Error);
+ MessageBox.Show(this, ex.ToString(), "NTFS Ensure Traverse Only", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
+
private async void ExecuteAdCreateButton_Click(object sender, RoutedEventArgs e)
{
try
@@ -950,7 +950,7 @@ namespace LiamWorkflowDiagnostics
}
}
- private async Task ExecuteProviderActionAsync(string actionName, Func> action, Func