private static void CopyPermissions(Node source, Node target)
{
if (source == null || source.ParentId == 0 || target == null)
return;
foreach (var entry in source.Security.GetEffectiveEntries())
{
target.Security.SetPermissions(entry.PrincipalId, true, entry.PermissionValues);
}
}