fix:本月已用流量和运营商周期月内已用流量代理企业不展示,其他账号新增权限

This commit is contained in:
sexygoat
2026-05-29 09:38:30 +08:00
parent 868a3352ad
commit a162dcc650
4 changed files with 74 additions and 2 deletions

View File

@@ -0,0 +1,37 @@
## ADDED Requirements
### Requirement: Asset Card Month Usage Field Permission
The asset information page SHALL gate the card information fields `本月已用流量` and `运营商周期月内已用流量` with the same permission code `asset_info:view_card_month_usage`.
The asset information page MUST hide both fields for logged-in accounts whose `user_type` is `3` (代理账号) or `4` (企业账号), regardless of whether the account has `asset_info:view_card_month_usage`.
#### Scenario: Show both fields when platform user has permission
- **GIVEN** 当前登录账号的 `user_type` 不是 `3` 也不是 `4`
- **AND** 用户拥有 `asset_info:view_card_month_usage`
- **WHEN** 页面渲染资产信息的卡信息区域
- **THEN** 页面 MUST 显示 `本月已用流量`
- **AND** 页面 MUST 显示 `运营商周期月内已用流量`
#### Scenario: Hide both fields when permission is missing
- **GIVEN** 当前登录账号的 `user_type` 不是 `3` 也不是 `4`
- **AND** 用户不拥有 `asset_info:view_card_month_usage`
- **WHEN** 页面渲染资产信息的卡信息区域
- **THEN** 页面 MUST NOT 显示 `本月已用流量`
- **AND** 页面 MUST NOT 显示 `运营商周期月内已用流量`
#### Scenario: Hide both fields for agent accounts
- **GIVEN** 当前登录账号的 `user_type``3`
- **WHEN** 页面渲染资产信息的卡信息区域
- **THEN** 页面 MUST NOT 显示 `本月已用流量`
- **AND** 页面 MUST NOT 显示 `运营商周期月内已用流量`
#### Scenario: Hide both fields for enterprise accounts
- **GIVEN** 当前登录账号的 `user_type``4`
- **WHEN** 页面渲染资产信息的卡信息区域
- **THEN** 页面 MUST NOT 显示 `本月已用流量`
- **AND** 页面 MUST NOT 显示 `运营商周期月内已用流量`