liuyun ed9af5337d
Some checks are pending
CI / backend (push) Waiting to run
CI / frontend (push) Waiting to run
docs(spec): 归档 tenant-brand + 同步租户品牌主 spec
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 22:33:21 +08:00

36 lines
1.2 KiB
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** 其用户/角色/资源/组织/字典/日志一并清理
### Requirement: 租户品牌维护
系统 SHALL 支持管理员在新增/编辑租户时填写品牌名、Logo、主色、版权,并在租户详情/列表中返回。
#### Scenario: 编辑租户品牌
- **WHEN** 管理员编辑某租户的品牌字段
- **THEN** 品牌字段保存并可查询