Saturday, May 1, 2010

Custom trimming not overriding the default trimming

Security trimming happens after the query runs. Items that are filtered as part of the query, due to ACLs in the index, will not be in the query results and so will not be passed to custom security trimmer.

Custom security trimmers always get fed with already trimmed results. This means a custom security trimmers does NOT replace SharePoint's own trimming mechanism and can only be used for additional trimming or for trimming results from sources that do not have ACLs defined on them (like BDC data).

It`s better avoid writing a custom security trimmer, because it often leads to scalability problems etc.

An easier way to get all the search results would be to wrap the search call to run under a different user who has access (say using SPSecurity.RunWithElevatedPrivileges) in a custom search webpart.

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/4b726cb6-7aa4-4888-b5be-0c5c44669abe/
http://msdn.microsoft.com/en-us/library/bb608305.aspx

No comments:

Post a Comment