I have a number of different roles in Sitecore. And I have set security permissions on my content items so that different roles can only access certain content items. It seems that Lucene will just index all of the content. And when I query Lucene it doesn't pay any attention to the security. Is there any way to get Lucene to only return items that the current Extranet user has access to?
Thanks,
Corey
Not to my knowledge. But when working through the Hits collection, you would normally have a loop similar to this:
for ( int i = 0; i < hits.Length() && i < Context.Current.Settings.MaxSearchResultsToProcess; i++ )
{
Item item = Index.GetItem( hits.Doc( i ), Context.Current.Database );
if ( item != null )
{
indexResultater.Add( item );
}
}
And since this runs in context of your current user, no results would be added to your results if the user cannot access them.