I think you could do this one of 2 ways. Either index everything and then on search result display check each result to see if the user has access to view and if they dont, leave it out of of the display. However paging these results could be problematic.
The way I would address it would be to do the following... Please note this is entirely off the top of my head and I am not 100% sure it would work exactly as typeed but give it a go and let me know.
The option would be to "stuff" the index with some of the public access information also, indexing which groups have access to your results. To do this you need to look at the GatheringNodeData event.
Just a thought if you cant get the path the way I have it here... you might just need to load the node from umbraco.NodeFactory and then just get the Path property.
Include role based protection data in Examine indexes
I need to ensure Examine searches only include protected content that the current user has access to.
So, this is possible two questions in one, how do you compile a search criteria using ExamineManager which is the equivalent of
so far I only filter Visible using umbracoNaviHide like so;
and
how would you get the public access data for protected nodes using IndexAttributeFields or IndexUserFields in ExamineIndex.config ?
thanks in advance.
W
Hi Wayne
I think you could do this one of 2 ways. Either index everything and then on search result display check each result to see if the user has access to view and if they dont, leave it out of of the display. However paging these results could be problematic.
The way I would address it would be to do the following... Please note this is entirely off the top of my head and I am not 100% sure it would work exactly as typeed but give it a go and let me know.
The option would be to "stuff" the index with some of the public access information also, indexing which groups have access to your results. To do this you need to look at the GatheringNodeData event.
Then in the event handler you want to use the Access class which has a method called GetAccessingMemberRoles
Then you should be able to access that info from your index and determine if it fits your access criteria.
Hope this at least give you some clues.
Just a thought if you cant get the path the way I have it here... you might just need to load the node from umbraco.NodeFactory and then just get the Path property.
Peter
is working on a reply...