131 字
1 分钟
基础rbac模型

alt text

下面是puml类图

@startuml rbac
class User {
Long id
String nickname
String username
String password
String email
String remark
Boolean isActive
timestamptz createdAt
timestamptz updatedAt
}
class Role {
Long id
String code
String name
String description
timestamptz createdAt
timestamptz updatedAt
}
class Permission {
Long id
String code
String name
String description
timestamptz createdAt
timestamptz updatedAt
}
note right of Permission::"String code"
权限的唯一标识符
- order:read
- order:write
end note
class UserRole {
Long id
Long userId
Long roleId
timestamptz createdAt
timestamptz updatedAt
}
class RolePermission {
Long id
Long roleId
Long permissionId
timestamptz createdAt
timestamptz updatedAt
}
User ---> UserRole : "userId"
UserRole ---> Role : "roleId"
Role ---> RolePermission : "roleId"
RolePermission ---> Permission : "permissionId"
@enduml
基础rbac模型
https://blog.inept.top/posts/base-rbac/
作者
无能酱
发布于
2026-01-14
许可协议
CC BY-NC-SA 4.0