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
970 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.

# Tenants Specification
## Purpose
定义租户域的行为:仅平台租户可管理租户;创建租户自动初始化(管理员/根组织/资源/字典),删除级联清理。
## Requirements
### Requirement: 平台级管理
租户管理 SHALL 仅平台租户(super_admin)可操作;tenant:* 权限仅平台授予。
#### Scenario: 业务租户越权
- **WHEN** 业务租户管理员尝试管理租户
- **THEN** 无 tenant:* 权限,返回 403
### Requirement: 租户 onboarding
创建租户 SHALL 自动初始化:根组织、tenant_super_admin 角色、管理员账号、全量资源(不含 tenant:*)、内置字典。
#### Scenario: 新租户可用
- **WHEN** 创建新租户
- **THEN** 其管理员可登录并访问菜单
### Requirement: 租户删除级联
删除租户 SHALL 级联清理其全部业务数据。
#### Scenario: 删除租户
- **WHEN** 删除租户
- **THEN** 其用户/角色/资源/组织/字典/日志一并清理