forked from EduCraft/curriculum-project-hub
678bc9f56c
- 角色格→角色体系 (3处) - 租户根/tenant root→租户 (3处) - 清理 Hierarchy/Organization/System 的 doc 注释
45 lines
1.4 KiB
Lean4
45 lines
1.4 KiB
Lean4
import Spec.Prelude
|
|
import Spec.System.User
|
|
|
|
/-!
|
|
# Hierarchy —— 主体层级
|
|
|
|
整个服务中的主体: 平台 → 组织(租户)→ 用户。
|
|
|
|
- **平台**(Platform): SaaS 提供方实体
|
|
|
|
- **组织**(Organization): SaaS 租户
|
|
|
|
- **用户**(User): 租户内的独立实体
|
|
|
|
**术语**: "管理员"一词在文档中不单独出现,避免跨层歧义。
|
|
-/
|
|
|
|
namespace Spec.System
|
|
|
|
variable (I : Identifiers)
|
|
/-- 平台(`PINNED`, SaaS 提供方)。只有一个,独立于组织。管理面见 `PlatformAdministration`(ADR-0023)。 -/
|
|
structure Platform where
|
|
/-- 平台自有飞书应用(`PINNED`, ADR-0023)。 -/
|
|
application : I.PlatformFeishuApplicationId
|
|
/-- 组织(`PINNED`, ADR-0020)。project/team 必须归属且仅归属一个 org。
|
|
角色/tenancy/凭据见 `Spec.System.Organization`。 -/
|
|
structure Organization where
|
|
/-- 组织标识(`OPEN` 表示)。 -/
|
|
id : I.OrganizationId
|
|
|
|
/-- 用户(`PINNED`, 租户层独立实体)。必属一个组织。飞书身份是绑定,见 `Spec.System.User`。 -/
|
|
structure User where
|
|
/-- 用户标识(`OPEN` 表示;组织内唯一,不可改;登录用)。 -/
|
|
id : I.UserId
|
|
/-- 所属组织(`PINNED`, ADR-0020)。 -/
|
|
organization : I.OrganizationId
|
|
/-- 显示名(`PINNED`, 可改)。 -/
|
|
displayName : String
|
|
/-- 密码哈希(`OPEN` 表示;id + 密码登录)。 -/
|
|
passwordHash : String
|
|
/-- 飞书绑定(`PINNED`, 可选)。 -/
|
|
feishu : Option (FeishuProfile I)
|
|
|
|
end Spec.System
|