hybris - Hybris PCM 产品类别限制
问题描述
我们正在实施 Hybris PCM,我们希望创建一些产品类别限制。
一些员工应该只找到具有特定类别的产品。例如,一些员工只能看到“演习”类别的产品,而其他员工只能看到“鞋子”类别的产品。
我们如何在 Backoffice 和 PCM 中做到这一点?
解决方案
搜索限制(个性化)可用于实现此目的:
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' }}) "
推荐阅读
- flutter - 无法加载资产图片
- javascript - 使用前瞻,如何确保至少包含 4 个字母数字字符 + 下划线
- logstash - 当目标端口不可用时,GELF 日志记录驱动程序会降低我的系统速度
- javascript - 如何使用 date-fns 库从月份名称中获取月份索引
- docker - Svelte 应用程序在本地机器上的 Docker 容器中显示空白页
- vue.js - 如何在输入/字段后显示错误消息
- c# - 使用 ASP-for 在 ASP.net MVC 中发布
- java - 在java中调整图像大小
- r - 展开循环会产生不同的行为
- ansible - Ansible如何提取字符串的一部分?