I need to prevent certain members appearing when a user is using the search facility in the back office. Does anyone know how you can filter the results or add an event to the search operation?
Thank you for this - but I am not sure it would work as it needs to be dynamic for the user. For instance User type exampleType1 is allowed to view certain members and User Type exampleType2 is allowed to view others.
Thanks - just wondering though if I can hook into an event that checks the url. For example I can check that the url contains member/edit/ then I can see if the current user has access to that member if not then redirect them to unauthorized.
Do you know (or anybody) know how I could do this?
Back-office Search Facility
Hi All,
I need to prevent certain members appearing when a user is using the search facility in the back office. Does anyone know how you can filter the results or add an event to the search operation?
Regards, L
Hello Luke,
If i have it correct then the search in de backoffice use Examine. So what you can do is hookup to the
ExamineManager.Instance.IndexProviderCollection["InternalMemberIndexer"].GatheringNodeData
and then remove the usernames that you don't want to be index.
Marcel
Thank you kindly Marcel,
Great info - do you know where I would hook into this?? Maybe Application Startup.
Regards, L
Hi Luke,
Yes but many this topic is more helpful and a beter solution.
https://our.umbraco.org/forum/core/general/30555-Programmatically-remove-an-item-from-Examine-Index-on-unpublish?p=0
it's for content but you can change it for members also, something like this:
Hi Marcel,
Thank you for this - but I am not sure it would work as it needs to be dynamic for the user. For instance User type exampleType1 is allowed to view certain members and User Type exampleType2 is allowed to view others.
I filtered out the members section with:
But needs something similar with the search facility.
Regards, L
Hi Luke,
I don't know a way to to filtering based on the user type in search. There is no event to hookup in the search result pipeline.
The only way i can think about it to do it with some kind of interceptor.
our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/53699-User-Message-former-Speech-bubble-in-custom-event#comment-197032
or by angular
https://github.com/kgiszewski/LearnUmbraco7/blob/master/Chapter%2011%20-%20Working%20with%20AngularJs%20for%20Customizing%20the%20Backoffice/06%20-%20Interceptors.md
But this are tricky and hacks not a really need solution.
Good luck
Hi,
Thanks - just wondering though if I can hook into an event that checks the url. For example I can check that the url contains member/edit/ then I can see if the current user has access to that member if not then redirect them to unauthorized.
Do you know (or anybody) know how I could do this?
Regards, L
is working on a reply...