locked
SharePoint Search FullTextSQLQuery RRS feed

  • Question

  • 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
    Wednesday, May 11, 2011 8:26 AM

All replies

  • 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/
    Wednesday, May 11, 2011 11:29 AM
  • 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
    • Marked as answer by David HM Monday, May 16, 2011 10:10 AM
    • Unmarked as answer by NisheethTak Tuesday, May 17, 2011 12:22 PM
    Thursday, May 12, 2011 12:07 AM
  • 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

    Tuesday, May 17, 2011 12:21 PM
  • 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.exe


    Warm Regards, Pratik Vyas | SharePoint Consultant | http://sharepointpratik.blogspot.com/
    • Marked as answer by David HM Thursday, May 19, 2011 1:21 AM
    • Unmarked as answer by NisheethTak Friday, May 27, 2011 6:40 AM
    Tuesday, May 17, 2011 1:46 PM
  • 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
    Friday, May 27, 2011 6:42 AM