Update ContentValueSetValidator to allow include/exclude of fields (#14177)

This commit is contained in:
Marc Goodson
2023-05-17 09:19:18 +01:00
committed by GitHub
parent 6fcdb1a6e4
commit 9640616b56

View File

@@ -19,10 +19,28 @@ public class ContentValueSetValidator : ValueSetValidator, IContentValueSetValid
// used for tests
public ContentValueSetValidator(bool publishedValuesOnly, int? parentId = null, IEnumerable<string>? includeItemTypes = null, IEnumerable<string>? excludeItemTypes = null)
: this(publishedValuesOnly, true, null, null, parentId, includeItemTypes, excludeItemTypes)
: this(publishedValuesOnly, true, null, null, parentId, includeItemTypes, excludeItemTypes, null, null)
{
}
[Obsolete("Use the overload accepting includeFields and excludeFields instead. This overload will be removed in Umbraco 14.")]
public ContentValueSetValidator(
bool publishedValuesOnly,
bool supportProtectedContent,
IPublicAccessService? publicAccessService,
IScopeProvider? scopeProvider,
int? parentId,
IEnumerable<string>? includeItemTypes,
IEnumerable<string>? excludeItemTypes)
: base(includeItemTypes, excludeItemTypes, null, null)
{
PublishedValuesOnly = publishedValuesOnly;
SupportProtectedContent = supportProtectedContent;
ParentId = parentId;
_publicAccessService = publicAccessService;
_scopeProvider = scopeProvider;
}
public ContentValueSetValidator(
bool publishedValuesOnly,
bool supportProtectedContent,
@@ -30,8 +48,10 @@ public class ContentValueSetValidator : ValueSetValidator, IContentValueSetValid
IScopeProvider? scopeProvider,
int? parentId = null,
IEnumerable<string>? includeItemTypes = null,
IEnumerable<string>? excludeItemTypes = null)
: base(includeItemTypes, excludeItemTypes, null, null)
IEnumerable<string>? excludeItemTypes = null,
IEnumerable<string>? includeFields = null,
IEnumerable<string>? excludeFields = null)
: base(includeItemTypes, excludeItemTypes, includeFields, excludeFields)
{
PublishedValuesOnly = publishedValuesOnly;
SupportProtectedContent = supportProtectedContent;