fix(index.ui): 客户卡片用customer.*角色控制显示

- customer.*角色: 看到真人认证、上传素材(2张)
- owner.superuser/reseller.operator: 看到全部6张
- 无角色/未登录: 不显示任何卡片
This commit is contained in:
yumoqing 2026-05-28 22:08:06 +08:00
parent 54184aedfe
commit 9ebd8e7a80

View File

@ -1,4 +1,6 @@
{% set roles = get_user_roles(get_user()) %}
{% set role_str = roles|join(',') %}
{% set is_customer = 'customer.' in role_str %}
{% set is_admin = 'owner.superuser' in roles or 'reseller.operator' in roles %}
{
"widgettype": "VBox",
@ -24,6 +26,7 @@
"minWidth": "280px"
},
"subwidgets": [
{% if is_customer or is_admin %}
{
"widgettype": "Button",
"options": {
@ -104,6 +107,7 @@
}
]
}
{% endif %}
{% if is_admin %}
,{
"widgettype": "Button",