robert
01/08/2025, 4:03 PMJemayn
01/09/2025, 7:59 AMcsharp
public class RestrictedContentIndexConfig : IUmbracoIndexConfig
{
private readonly IPublicAccessService _publicAccessService;
private readonly IScopeProvider _scopeProvider;
public RestrictedContentIndexConfig(
IPublicAccessService publicAccessService,
IScopeProvider scopeProvider
)
{
_publicAccessService = publicAccessService;
_scopeProvider = scopeProvider;
}
public IContentValueSetValidator GetContentValueSetValidator() =>
new ContentValueSetValidator(false, true, _publicAccessService, _scopeProvider);
public IContentValueSetValidator GetPublishedContentValueSetValidator() =>
new ContentValueSetValidator(true, true, _publicAccessService, _scopeProvider);
public IValueSetValidator GetMemberValueSetValidator() => new MemberValueSetValidator();
}
and register it in a composer:
builder.Services.AddSingleton<IUmbracoIndexConfig, RestrictedContentIndexConfig>();
Then it will support restricted content.Nik
01/09/2025, 10:31 AMbuilder.Services.ConfigureOptions<ConfigureIndexOptions>();
I had some issues where my ordering was incorrect, so my code was hitting and then another package/tool was overriding my setup, so the order you add things will matter.A hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by