Bound NTFS AD group name lengths
This commit is contained in:
@@ -189,16 +189,39 @@ namespace C4IT_IAM_Engine
|
||||
tags.Add("GROUPTYPEPOSTFIX", GroupTypeTag);
|
||||
tags.Add("SCOPETAG", GroupScopeTag);
|
||||
|
||||
template.NamingTemplate = Helper.ApplyTemplatePlaceholders(template.NamingTemplate, template.Type != SecurityGroupType.Traverse, relativePath, sanitizedSegments, folderName)
|
||||
var replacementTags = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
if (customTags != null)
|
||||
{
|
||||
foreach (var customTag in customTags)
|
||||
replacementTags[customTag.Key] = customTag.Value;
|
||||
}
|
||||
foreach (var tag in tags)
|
||||
replacementTags[tag.Key] = tag.Value;
|
||||
|
||||
var boundedNameContext = Helper.GetBoundedAdGroupTemplateContext(
|
||||
template.NamingTemplate,
|
||||
template.Type != SecurityGroupType.Traverse,
|
||||
relativePath,
|
||||
sanitizedSegments,
|
||||
folderName,
|
||||
replacementTags,
|
||||
Helper.MaxAdGroupNameLength,
|
||||
$"{template.Type}/{template.Scope} fuer '{newFolderPath}'");
|
||||
|
||||
var adjustedSegments = boundedNameContext.SanitizedSegments ?? Array.Empty<string>();
|
||||
var adjustedRelativePath = adjustedSegments.Length > 0 ? string.Join("_", adjustedSegments) : string.Empty;
|
||||
var adjustedFolderName = boundedNameContext.FolderName;
|
||||
|
||||
template.NamingTemplate = Helper.ApplyTemplatePlaceholders(template.NamingTemplate, template.Type != SecurityGroupType.Traverse, adjustedRelativePath, adjustedSegments, adjustedFolderName)
|
||||
.ReplaceTags(customTags).ReplaceTags(tags)
|
||||
.ToUpper();
|
||||
|
||||
template.DescriptionTemplate = Helper.ApplyTemplatePlaceholders(template.DescriptionTemplate, template.Type != SecurityGroupType.Traverse, relativePath, sanitizedSegments, folderName)
|
||||
template.DescriptionTemplate = Helper.ApplyTemplatePlaceholders(template.DescriptionTemplate, template.Type != SecurityGroupType.Traverse, adjustedRelativePath, adjustedSegments, adjustedFolderName)
|
||||
.ReplaceTags(customTags).ReplaceTags(tags)
|
||||
.ToUpper();
|
||||
|
||||
|
||||
template.WildcardTemplate = Helper.ApplyTemplatePlaceholders(template.WildcardTemplate, template.Type != SecurityGroupType.Traverse, relativePath, sanitizedSegments, folderName)
|
||||
template.WildcardTemplate = Helper.ApplyTemplatePlaceholders(template.WildcardTemplate, template.Type != SecurityGroupType.Traverse, adjustedRelativePath, adjustedSegments, adjustedFolderName)
|
||||
.ReplaceTags(customTags).ReplaceTags(tags)
|
||||
.ToUpper();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user