views:

50

answers:

2

I'm currently working on an ASP.NET 3.5 intranet that uses role-based security, both on the page level and the page content level in some cases. I'd like to implement a site-wide search, but restrict results according to what the current user would normally see when they visit a given page. I suppose it would have to index the site separately for each user?

I've searched the ASP.NET community control gallery as well as Google, and have not found anything that can index in such a specific way. Can anyone offer a link to a pre-built control/solution that will handle this scenario, or a custom technique that I could try?

Thanks.

A: 

If you store somewhere that what content is accessible to what roles then it is only matter of another join in your query.

Another but expensive option is to get the search results and then filter them based on the accessibility of requesting user.

TheVillageIdiot
A: 

Basically, for each URL you retrieve you could have extra attributes to map the user to the resource as follows:

<a href="~/somepage.aspx" id="someLink" RoleAuth="xxx" RoleArgs="yyy" runat="server" />

Then you could use a Web Part, control, etc., to display each result link based on the user's logged-in credentials :-)

IrishChieftain
This is the best solution I've seen so far. Looks like it will achieve the level of granularity I am looking for.
Jason B