模板 / erDiagram

RBAC 权限数据模型

基于角色的访问控制模型,将用户关联到角色,角色再关联到权限。

在 Studio 中打开

预览

Mermaid 11 渲染器

正在渲染预览...

Mermaid 源码

erDiagram

erDiagram
    USER ||--o{ USER_ROLE : has
    ROLE ||--o{ USER_ROLE : "assigned to"
    ROLE ||--o{ ROLE_PERMISSION : grants
    PERMISSION ||--o{ ROLE_PERMISSION : "granted by"
    USER {
        int id PK
        string email
    }
    ROLE {
        int id PK
        string name
    }
    PERMISSION {
        int id PK
        string action
        string resource
    }
    USER_ROLE {
        int user_id FK
        int role_id FK
    }
    ROLE_PERMISSION {
        int role_id FK
        int permission_id FK
    }

更多模板