liuyun a397981b90
Some checks are pending
CI / backend (push) Waiting to run
CI / frontend (push) Waiting to run
docs: 补 backend users/roles/orgs/tenants/configs 主 spec + 审计清单收尾
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 17:03:06 +08:00

29 lines
977 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Roles Specification
## Purpose
定义角色域的行为:分页查询、创建/编辑(保留角色码校验)、删除(级联清理关联)、资源分配(事务化、平台级权限隔离)。
## Requirements
### Requirement: 角色增删改
系统 SHALL 支持角色 CRUD;保留角色码(super_admin/tenant_super_admin)不可创建、不可删除。
#### Scenario: 保留角色保护
- **WHEN** 尝试创建或删除保留角色码
- **THEN** 返回 400 拒绝
### Requirement: 删除级联
删除角色 SHALL 级联清理 user_role/role_resource/role_org 关联,并清该租户权限缓存。
#### Scenario: 删除角色
- **WHEN** 删除某角色
- **THEN** 其关联与权限缓存一并清理
### Requirement: 资源分配
分配资源 SHALL 事务化替换;平台级权限(tenant:*)仅平台租户可授予。
#### Scenario: 业务租户分配
- **WHEN** 非平台租户分配含 tenant:* 的资源
- **THEN** 平台级权限被剥离