on ‎2018 Oct 31 12:47 PM
Hi Experts,
I want to display Role specific categories in Back office product cockpit perspective .
Ex:If Grocery department role user login into the back office then only display the grocery related categories and products.please the below image instead of displaying the catalogs ,i need display role specific categories .

Request clarification before answering.
Can you try this
1) Create a new class MyBackofficeFacetSearchStrategy extends DefaultFacetSearchStrategy , and in the search call add a condtion(FilterRawQuery) based on current user against the allowedUsers attribute that you will index below
2) Update the Backoffice index with allowedUsers attribute where you have a list of users which are allowed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi - you need to create a SearchRestriction e.g. I have imported the following ImpEx to create a SearchRestriction in order to limit a backoffice productcockpit user, TestProductManager to see only category 577 (Webcams) in electronicsProductCatalog. Instead of restricting a specific user, you can replace TestProductManager with the ID of a user group in this ImpEx .
INSERT_UPDATE SearchRestriction;code[unique=true];generate;active;principal(uid);restrictedType(code);query
;my_category_restriction;TRUE;TRUE;TestProductManager;Category;{PK} IN ( {{SELECT {cat.PK} FROM {Category as cat JOIN Catalog as c ON {cat.catalog} = {c.PK}} WHERE {c.id} = 'electronicsProductCatalog' AND {cat.code} = '577'}})

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You had not mentioned this requirement 🙂 but I am glad to see that you have already solved your problem.
Of course, the one which I have mentioned is applicable only when data is coming from the database.
A general note for the ones who are new to Hybris: Restrictions are rules obeyed by FlexibleSearch which allow limiting search results depending on which type is searched and which user is currently logged in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.