Skip NTFS ensure and traverse on share roots

This commit is contained in:
Meik
2026-03-18 15:54:42 +01:00
parent eb6f23321d
commit 9d9575c9ef
2 changed files with 33 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ namespace C4IT_IAM_SET
public ICollection<string> ownerUserSids;
public ICollection<string> readerUserSids;
public ICollection<string> writerUserSids;
public Func<string, bool> CanManagePermissionsForPath;
public bool forceStrictAdGroupNames;
public bool WhatIf;
@@ -481,6 +482,22 @@ namespace C4IT_IAM_SET
break;
}
if (CanManagePermissionsForPath != null && !CanManagePermissionsForPath(parent.FullName))
{
DefaultLogger.LogEntry(LogLevels.Debug, $"Überspringe Traverse-Verarbeitung für nicht verwaltbaren NTFS-Pfad: {parent.FullName}");
parent = parent.Parent;
if (parent != null)
{
lvl = DataArea.GetRelativePath(parent.FullName, baseFolder).Count(n => n == Path.DirectorySeparatorChar);
DefaultLogger.LogEntry(LogLevels.Debug, $"Neue Ebene (lvl) nach Überspringen: {lvl}");
}
else
{
DefaultLogger.LogEntry(LogLevels.Debug, "Parent nach Überspringen ist null.");
}
continue;
}
DefaultLogger.LogEntry(LogLevels.Debug, $"Hole ACL für Ordner: {parent.FullName}");
AuthorizationRuleCollection ACLs = null;
try