Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Custom search results for global search

ShivaniTandon
Level 1
Level 1

How to restrict the assets of a particular folder from appearing in global or filter search results based on role of a user

1 Accepted Solution
davidjgonzalezzzz
Correct answer by
Level 5
Level 5

Another interesting solution could be the following:

 

1. For each role/path combo - create a  Hidden predicate on the Assets Search Form 

1. Use the excludespaths QueryBuilder predicate to exclude a specific path/path-pattern -- test this out as excludepaths seems like it might be a little slower, you might be able to figure out how to do the inverse using the paths predicate as well.

1. Permission those hidden predicates nodes in the JCR to be only read-able by members in the role that shouldn't be able to see assets in those folders.

 

This is effectively selectively toggling the inclusion of Search Form predicates that exclude paths, based on the users permission (which should be mapped to a user group/role).

 

As I mentioned, performance test this to make sure it's OK, but you should be able to work something out w/ this that only affects OOTB Assets Search experience. Also, double-check all the places users might search from to ensure these predicates are evaluated there (ex. I don't think they're evaluated from the Page Editor sidebar) ... If you need something TRULY global, i think ACLs on the folders/assets themselves are going to end up being your answer.

 

 

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/querybuilder-predicate-referen...

2021-02-17 at 1.18 PM.png

View solution in original post

2 Replies
davidjgonzalezzzz
Level 5
Level 5

Can you simply deny read permissions on the folder for the user group that maps to this role?


That will obviously result in these users not being able to browse (or in general, see) these assets, but it sounds like you might not want that anyhow?

 

davidjgonzalezzzz
Correct answer by
Level 5
Level 5

Another interesting solution could be the following:

 

1. For each role/path combo - create a  Hidden predicate on the Assets Search Form 

1. Use the excludespaths QueryBuilder predicate to exclude a specific path/path-pattern -- test this out as excludepaths seems like it might be a little slower, you might be able to figure out how to do the inverse using the paths predicate as well.

1. Permission those hidden predicates nodes in the JCR to be only read-able by members in the role that shouldn't be able to see assets in those folders.

 

This is effectively selectively toggling the inclusion of Search Form predicates that exclude paths, based on the users permission (which should be mapped to a user group/role).

 

As I mentioned, performance test this to make sure it's OK, but you should be able to work something out w/ this that only affects OOTB Assets Search experience. Also, double-check all the places users might search from to ensure these predicates are evaluated there (ex. I don't think they're evaluated from the Page Editor sidebar) ... If you need something TRULY global, i think ACLs on the folders/assets themselves are going to end up being your answer.

 

 

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/querybuilder-predicate-referen...

2021-02-17 at 1.18 PM.png

View solution in original post