Create NTFS traverse groups lazily

This commit is contained in:
Meik
2026-07-10 09:02:32 +02:00
parent 077bac99ae
commit af5f0784b8
2 changed files with 26 additions and 1 deletions

View File

@@ -656,6 +656,29 @@ namespace C4IT_IAM_SET
continue;
}
if (PathsEqual(parent.FullName, sourcePath) && string.IsNullOrWhiteSpace(traverseGroupName))
{
DefaultLogger.LogEntry(LogLevels.Debug, $"Skip own Traverse-Gruppe fuer '{parent.FullName}' because no child permission or traverse group needs it.");
if (IsTraverseBoundaryPath(parent.FullName))
break;
parent = parent.Parent;
if (parent != null)
{
currentTraverseLevel = hasTraverseBoundary
? currentTraverseLevel + 1
: DataArea.GetRelativePath(parent.FullName, baseFolder).Count(n => n == Path.DirectorySeparatorChar);
if (!hasTraverseBoundary)
defaultTraverseLoopIndex--;
DefaultLogger.LogEntry(LogLevels.Debug, $"Neue Ebene (lvl) nach Lazy-Skip: {currentTraverseLevel}");
}
else
{
DefaultLogger.LogEntry(LogLevels.Debug, "Parent nach Lazy-Skip ist null.");
}
continue;
}
DefaultLogger.LogEntry(LogLevels.Debug, $"Hole ACL für Ordner: {parent.FullName}");
AuthorizationRuleCollection ACLs = null;
try