首页 > 解决方案 > Hybris PCM 产品类别限制

问题描述

我们正在实施 Hybris PCM,我们希望创建一些产品类别限制。

一些员工应该只找到具有特定类别的产品。例如,一些员工只能看到“演习”类别的产品,而其他员工只能看到“鞋子”类别的产品。

我们如何在 Backoffice 和 PCM 中做到这一点?

标签: hybrisbackoffice

解决方案


搜索限制(个性化)可用于实现此目的:

INSERT_UPDATE SearchRestriction;code[unique=true];active;generate;restrictedType(code);principal(uid);query
                               ;Product_restriction_1; true; false; Product; usergroup1; "{category} in ({{ select {pk} from {Category} where {code}='category1' }})"
                               ;Product_restriction_2; true; false; Product; usergroup2; "{category} in ({{ select {pk} from {Category} where {code}='category1' }})"

这里属于 usergroup1 的员工可以看到属于 category1 的产品,而 usergroup2 可以看到属于 category2 的产品(上面给出的这些查询只是一些用于快速理解概念的虚拟查询)。

限制类型=产品主体=用户/用户组对应后台员工登录

满足您要求的更具体的查询是:

select {r.target} from { CategoryProductRelation as r join Category as c on {r.source}= {c.pk} } where {c.code}='shoes'

因此,请使用类似的 impex:

INSERT_UPDATE SearchRestriction;code[unique=true];active;generate;restrictedType(code);principal(uid);query
                           ;Product_restriction_shoes; true; false; Product; shoeUser; " {pk} in ({{select {r.target} from { CategoryProductRelation as r join Category as c on {r.source}= {c.pk} } where {c.code}='shoes' }}) "

推荐阅读