SharePoint Search FullTextSQLQuery
HI,
I am using fulltextsqlquerty to retrieve the content from the SharePoint server 2007 and it is returning all the content which is related to that text.
My issue is it's not checking that which is current user.
It is also giving that document which is not access to the current user. How I can restrict the search to get only that search document which current user has the access.
Thanks in advance.
Nisheeth
May 11th, 2011 4:29am
Hi Nisheeth,
What if the user doesn't have access click on the link got in search result ?
Is it giving access denied page or any error or user is able to access the link ?Warm Regards, Pratik Vyas | SharePoint Consultant | http://sharepointpratik.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2011 7:30am
Can you validate that the user performing the search doesn't have access to that specific content? When you navigate to that specific link, does that user get an "Access Denied" message? Verifying that the user does/doesn't have access to that
content would be the first step in trying to debug this issue.
- M- Michael Mukalian - 2010 MS MVP SharePoint Services - MCTS: MOSS 2007 Configuration - http://www.mukalian.com/blog
May 11th, 2011 8:08pm
Yes it saying that you dont have access.
But I dont know how I can check that user have the access to that content or not..
Can you please let me know how can I do that?
I am using
using (SPSite site = new SPSite(siteUrl,usertoken))
{
SPWeb CRsite = site.RootWeb;
FullTextSqlQuery fts = new FullTextSqlQuery(site);
StringBuilder sb = new StringBuilder();
searchText = searchText.Replace("'", "''").Replace("\"", "\"\"");
sb.Append("SELECT Title,Path, Description, SiteName FROM SCOPE()");
fts.QueryText = sb.ToString();
fts.ResultTypes = ResultType.RelevantResults;
ResultTableCollection rtc = fts.Execute(); if (rtc.Count > 0)
{
using (ResultTable relevantResults = rtc[ResultType.RelevantResults])
retResults.Load(relevantResults, LoadOption.OverwriteChanges);
}
}
In retResult all the content is coming... but I need only that content where this user has access.
Nisheeth
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2011 8:23am
Hi Nisheeth,
here is the tool through which you can check user permission, you can check the user is added to which groups in whole web application and this way you can get idea of user permission
please take a look @
http://www.theblackknightsings.com/ct.ashx?id=657139ba-bd80-42af-a4bd-107516bff6b8&url=http%3a%2f%2fwww.theblackknightsings.com%2fcontent%2fbinary%2fListUsersGroups.exeWarm Regards, Pratik Vyas | SharePoint Consultant | http://sharepointpratik.blogspot.com/
May 17th, 2011 9:46am
I cant use any other tools..Can you please let me know that code only where I can use or check the content permission??
Nisheeth
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2011 2:45am