Gate NTFS share ensure behind config
This commit is contained in:
@@ -893,16 +893,24 @@ namespace C4IT.LIAM
|
||||
IEnumerable<string> ownerSids,
|
||||
IEnumerable<string> readerSids,
|
||||
IEnumerable<string> writerSids,
|
||||
bool allowSharePathEnsure = false,
|
||||
bool ensureTraverseGroups = false,
|
||||
bool whatIf = false)
|
||||
{
|
||||
var classification = ClassifyPath(folderPath);
|
||||
if (!IsSupportedPermissionManagedPathKind(classification, eNtfsPathKind.Folder, eNtfsPathKind.ClassicShare, eNtfsPathKind.DfsLink))
|
||||
var allowShareKinds = allowSharePathEnsure;
|
||||
if (!IsSupportedPermissionManagedPathKind(
|
||||
classification,
|
||||
allowShareKinds
|
||||
? new[] { eNtfsPathKind.Folder, eNtfsPathKind.ClassicShare, eNtfsPathKind.DfsLink }
|
||||
: new[] { eNtfsPathKind.Folder }))
|
||||
{
|
||||
return Task.FromResult(new ResultToken(System.Reflection.MethodBase.GetCurrentMethod().ToString())
|
||||
{
|
||||
resultErrorId = 30008,
|
||||
resultMessage = $"NTFS permission ensure is only supported for folder and share paths. DFS namespaces and server roots are skipped: {folderPath}"
|
||||
resultMessage = allowShareKinds
|
||||
? $"NTFS permission ensure is only supported for folder and share paths. DFS namespaces and server roots are skipped: {folderPath}"
|
||||
: $"NTFS permission ensure is only supported for folder paths unless share support is explicitly enabled. Shares, DFS namespaces and server roots are skipped: {folderPath}"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user