More in this section

Forums / Developing with Sitefinity / Search results and pages roles

Search results and pages roles

2 posts, 0 answered
  1. Olivier
    Olivier avatar
    11 posts
    13 May 2008
    08 Jul 2008
    Link to this post

    I have defined a search index that indexes all public and non public pages.
    I have many roles and my application have public pages as well as non public pages, that only particular roles should access.
    I am using the SearchManager.Search method to retrieve the search result within the pages of the website.
    My problem is that every pages are returned by the Search Method, even those which require an authentication or those that are restricted to particular roles.If i had only public and just one role i guess i could have 2 different search index and request the the good index in my query (whether user is autenticated or not), but as i have many roles, i'm wondering what is the best way?
    Should i parse the result and make my own check on every pages returned?


  2. Nikola
    Nikola avatar
    51 posts
    24 Sep 2012
    09 Jul 2008
    Link to this post
    Hello Olivier,

    Probably the best way to restrict results based on user roles is to create separate indexes as you already suggested.
    You can create index for a group of pages accessible to certain roles and set up the SearchBox control on those pages to use the index or to point it in the code you're using.

    This requires that the access level of the pages is based on their hierarchy. All child pages for a restricted page will be indexed if you select the restricted page as a Starting node to index. 

    Parsing the result and check every page is will lead to unnecessary slow down which, of course, depends on the number of results returned.

    Don't hesitate to contact us if you have other questions.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered