fix:本月已用流量和运营商周期月内已用流量代理企业不展示,其他账号新增权限
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Change: 为资产卡信息月内流量字段增加权限控制
|
||||
|
||||
## Why
|
||||
|
||||
资产信息页卡信息中的“本月已用流量”和“运营商周期月内已用流量”属于敏感用量字段,需要统一通过同一个权限编码控制可见性,并对代理账号和企业账号强制隐藏。
|
||||
|
||||
## What Changes
|
||||
|
||||
- 为资产信息页卡信息中的“本月已用流量”增加权限控制。
|
||||
- 为资产信息页卡信息中的“运营商周期月内已用流量”增加相同权限控制。
|
||||
- 两个字段统一使用权限编码 `asset_info:view_card_month_usage`。
|
||||
- 当当前登录账号 `user_type` 为 `3` 代理账号或 `4` 企业账号时,即使拥有权限也不显示这两个字段。
|
||||
|
||||
## Impact
|
||||
|
||||
- Affected specs:
|
||||
- `asset-card-usage-field-permission`
|
||||
- Affected code:
|
||||
- `src/views/asset-management/asset-information/components/BasicInfoCard.vue`
|
||||
- 角色/权限树配置中与 `asset_info:view_card_month_usage` 相关的注册位置
|
||||
@@ -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 显示 `运营商周期月内已用流量`
|
||||
@@ -0,0 +1,6 @@
|
||||
## 1. Implementation
|
||||
|
||||
- [x] 1.1 在资产信息页卡信息中为“本月已用流量”接入 `asset_info:view_card_month_usage` 权限
|
||||
- [x] 1.2 在资产信息页卡信息中为“运营商周期月内已用流量”接入同一个 `asset_info:view_card_month_usage` 权限
|
||||
- [x] 1.3 确保 `user_type` 为 `3` 代理账号或 `4` 企业账号时隐藏上述两个字段
|
||||
- [x] 1.4 完成 OpenSpec 严格校验
|
||||
Reference in New Issue
Block a user