London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Loading...
Area: Optimizely Search & Navigation
ARCHIVED This content is retired and no longer maintained. See the latest version here.

This topic describes access rights filtering when EPiServer Find is integrated with EPiServer 7/7.5 CMS.

The search engine does not filter documents (such as pages or files) according to access rights. But, if you integrate Find with the EPiServer CMS, the return values from the IContent extension methods RolesWithReadAccess and UsersWithReadAccess are indexed. Use these methods to filter content that the current user does not have permission to see.

For example:

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

Last updated: Sep 21, 2015