Skip to content

Commit

Permalink
Generic IgnoreAlias setting for all handlers - stops them being impor…
Browse files Browse the repository at this point in the history
…ted completely. #178
  • Loading branch information
Kevin Jump committed Oct 20, 2020
1 parent d89974c commit a171a44
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions uSync8.BackOffice/SyncHandlers/SyncHandlerRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,22 @@ virtual protected bool ShouldImport(XElement node, HandlerSettings config)
return false;
}
}


// Ignore alias setting.
// if its set the thing with this alias is ignored.
var ignore = config.GetSetting<string>("IgnoreAliases", string.Empty);
if (!string.IsNullOrWhiteSpace(ignore))
{
var ignoreList = ignore.ToDelimitedList();
if (ignoreList.InvariantContains(node.GetAlias()))
{
logger.Debug(handlerType, "Ignore: Item {alias} is in the ignore list", node.GetAlias());
return false;
}
}


return true;
}

Expand Down

0 comments on commit a171a44

Please sign in to comment.