Replies: 1 comment
-
|
when is user login coming? also the local storage / indexdb storage for plugins / mcps means we are not able to easily start the same docker instance (even from the same ssh machine) without some coding work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
背景
为后续团队版、API 模式提供基础的权限管理能力。
设计思路
在 LobeChat 中添加 RBAC 相关功能表结构

采用经典的五表设计模式,ER图如下:
核心表 - 用户表(现有)
复用系统现有的用户基础信息表,存储用户的基本信息如邮箱、用户名、头像等
通过 user_roles 表将用户与角色建立关联
核心表 - roles (角色表)
定义系统中的各种角色:
name: 角色标识符 (如 'admin', 'user')display_name: 前台页面展示的角色名称is_system: 标识是否为系统内置角色is_active: 支持角色的启用/禁用核心表 - permissions (权限表)
定义系统中的所有权限:
code: 权限代码,由三部分组成:{分类}:{操作类型}:{数据范围}category: 权限所属分类,便于管理is_active: 支持权限的启用/禁用关联表 - role_permissions (角色权限关联表)
实现角色与权限的多对多关系:
在创建表时,注意:
(roleId, permissionId)构成的主键roleId、permissionId建立索引关联表 - user_roles (用户角色关联表)
实现用户与角色的多对多关系:
同时,添加了额外的角色过期时间
expires_at字段,实现临时授权在创建表时,注意:
(user_id, role_id)构成的主键roleId、userId建立索引表关联关系说明
用户 ↔ 角色: 多对多关系
角色 ↔ 权限: 多对多关系
进展
Beta Was this translation helpful? Give feedback.
All reactions