Skip to content

Ch04. Constitution 权限体系

RBAC 5 角色模型 — 从配置文件到运行时权限守卫。

本章概要

Constitution 是 AutoSnippet 的权限中枢,通过 YAML 配置定义角色、权限和行为边界。本章解析权限模型的设计思路、运行时检查机制以及与 Gateway 的协作方式。

问题场景

设计决策

RBAC 5 角色模型

配置即代码

核心实现

Constitution 加载流程

运行时权限检查

数据流

constitution.yaml → ConfigLoader → ConstitutionService → Gateway.validate()

                                                    Permission Check

                                                    Allow / Deny

关键代码

小结

Released under the MIT License.