Try our conversational search powered by Generative AI!

Custom filtering to find all files under accessible folder

Vote:
 

I'm building a searching page, where could find all document including pdf, word, excel ... now it's working well, however some folders are just accessible by some particular users/groups, so all documents under these folders should not be shown in the search result.

Now, we are post-processing the result list, and check permission of parent folder, if current user doesn't have permisson to read that folder, the result should be removed from list. However the paging is not working properly, because total result is wrong, and number of displaying item on each page is not consistent. We are changing the implementation to build a custom filter, to check parent folder permission, and just get relevant item from EPi find, we don't know how to do that with EPi Find client, anyone please help to solve that problem 

#152552
Aug 25, 2016 11:00
Vote:
 

For filtering on access rights there is an extension method for that

SearchClient.Instance.Search<StandardPage>()
    .For("Possibly secret stuff")
    .Filter(x => x.RolesWithReadAccess().Match("Everyone"))
    .GetContentResult();
#152567
Aug 25, 2016 13:25
Vote:
 

Thanks @Daniel for your quick answer, however it's checking for current item, what I'm looking for is checking parent folder permission, not current item

#152605
Aug 26, 2016 4:54
Vote:
 

Then I would either make sure the current items actually have those access rights. Since they are normally inherited that should be easy but maybe you have some reason why you are not using that?

Otherwise I would create a new separate field on the indexed file for that logic and filter on that.

#152608
Aug 26, 2016 9:30
Vote:
 

Hi Daniel, actually the search page is working for File searching, including PDF and Word document file, so we have to base on folder permisson instead of File permission

#152616
Aug 26, 2016 11:38
Vote:
 

Ok, don't know how you store the files but in normal Episerver solutions you can set access rights on the files as well from the file manager and then use Find to filter them. Then you get out of the box support for that.

#152620
Aug 26, 2016 12:19
Vote:
 

Hi Daniel, in my current website, we are setting access rights on folder level, not on an individual file, because there are a lot of file in the existing site.

#152628
Aug 26, 2016 12:48
Vote:
 

That's good. But if you set them on the folder they will also be inherited to the file itself. So the expression above should work if I'm not missing anything here... 

#152635
Aug 26, 2016 14:30
Vote:
 

Hi Daniel, I tried to set permission on the folder, and checked the permission on EPi Find, it worked well for folder, however the permission for all files belong to that folder didn't change on EpiFind

#153261
Aug 29, 2016 12:41
Vote:
 

Try reindex the file either by publishing it again or run the job. Then you can check access rights of the file first in Episerver and then in Episerver find index browser. Should be inherited in both.

#154287
Aug 30, 2016 6:25
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.