feat: 实现角色定义系统

- 创建角色定义基类 RoleDefinition
- 实现管理员角色 AdminRole
- 实现普通用户角色 UserRole
- 实现测试用户角色 TestRole
- 实现角色工厂 RoleFactory
- 添加完整的单元测试
- 更新 vitest 配置以包含角色定义测试

所有角色统一使用密码: Test@123
This commit is contained in:
张翔
2026-04-04 20:43:25 +08:00
parent 4732b9ef02
commit 54ea704f27
9 changed files with 203 additions and 3 deletions
@@ -0,0 +1,16 @@
export interface RoleDefinition {
name: string;
displayName: string;
credentials: {
username: string;
password: string;
};
permissions: string[];
cannotAccess: string[];
expectedBehaviors: {
canCreate: string[];
canRead: string[];
canUpdate: string[];
canDelete: string[];
};
}