SearchDataSource PageHits always have ACL set to Everyone,FullAccess

Per Nergård
Member since: 2007


 Im working on a slightly modified search page. In the search result I want to display an icon for pages and files if not the role "Everyone" has read access. Got it to work for pages no problem but I discoverd that for filehits the pageData.ACL is always set to Everyone with fullaccess.

Could I use the PageLinkURL property and parse out the file name and do a check on the actual folder?

 If it's possible to set the correct ACL for pagehits in the searchdatasource with not to much of a hassle and performance issues I think it would be a nice feature for the next release.


 Per N 


#27074 Jan 16, 2009 9:21
  • Per Nergård
    Member since: 2007

    I can answer my own question.

    If you filter out the document name from the pageData.PageName you can do something like this:


    UnifiedDirectory directory = HostingEnvironment.VirtualPathProvider.GetDirectory(path) as UnifiedDirectory;

    return directory.ACL.QueryDistinctAccess(PrincipalInfo.AnonymousPrincipal, AccessLevel.Read);


    catch (UnauthorizedAccessException ex)


    return false;


    #27177 Jan 19, 2009 16:37