public List <SearchResult> PerformSearch(StringBuilder query, SearchViewModel model) { var searcher = ExamineManager.Instance.SearchProviderCollection[_config.SearchSearcher]; var criteria = searcher.CreateSearchCriteria(); ISearchCriteria criteria2 = criteria.RawQuery(query.ToString()); var results = searcher.Search(criteria2) .Where(x => ( !_helper.IsProtected(x.Fields[StaticValues.Properties.Path]) || (_helper.IsProtected(x.Fields[StaticValues.Properties.Path]) && _helper.MemberHasAccess(x.Fields[StaticValues.Properties.Path]))) && ( (x.Fields[StaticValues.Properties.__IndexType] == UmbracoExamine.IndexTypes.Content && _helper.TypedContent(int.Parse(x.Fields[StaticValues.Properties.Id])) != null) || (x.Fields[StaticValues.Properties.__IndexType] == UmbracoExamine.IndexTypes.Media && _helper.TypedMedia(int.Parse(x.Fields[StaticValues.Properties.Id])) != null) )) .ToList(); return(results); }
public static bool HasAccess(this IPublishedContent content) { return(Helper.MemberHasAccess(content.Id, content.Path)); }