Loading...
Area: Episerver Find
Applies to versions: 12 and higher
Other versions:

Access rights

The search engine does not apply access rights filtering for documents such as pages or files. However, when using the Episerver CMS integration, the return value from extension methods for IContent named RolesWithReadAccess and UsersWithReadAccess are indexed. This means that we can filter out content that the current user should not be able to see.

Examples

An example of filtering using RolesWithReadAccess:

SearchClient.Instance.Search<StandardPage>()
    .For("Possibly secret stuff")
    .Filter(x => x.RolesWithReadAccess().Match("Everyone"))
    .GetContentResult();

Last updated: Oct 31, 2016