on 2018 Mar 27 11:29 AM
Hi experts,
I have been trying to disable search restrictions before calling super categories method of product model but apparently restriction does not seem to be disabling as intended result is not being returned.
final ProductModel product = productService.getProductForCode("100100");
final Collection<CategoryModel> categories = fetchCategories(() -> product.getSupercategories());
// I always get categories empty if I have put restrictions on product's super categories.
private <T> T fetchCategories(final Supplier<T> supplier) {
return sessionService.executeInLocalView(new SessionExecutionBody() {
@Override
public T execute() {
try{
searchRestrictionService.disableSearchRestrictions();
sessionService.setAttribute("disableRestrictionGroupInheritance", Boolean.TRUE);
return supplier.get();
}finally{
searchRestrictionService.enableSearchRestrictions();
}
}
}, userService.getAdminUser());
}
Request clarification before answering.
I'm also struggling with an issue related to this. Did you get to resolve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi... I am facing one similar issue. Were you able to get any help in this issue ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 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.