chore: check off Task 2 (RbacModule + RbacService)

This commit is contained in:
2026-07-02 11:26:03 +08:00
parent 23e96dcfbd
commit cd62a6dbe2
2 changed files with 10 additions and 10 deletions

View File

@@ -260,7 +260,7 @@ git commit -m "feat(rbac): add Permission and Role entities, update User entity"
**依赖**: 先用 `forwardRef` 占位 AuthModule 引用Task 3 解决循环依赖。
- [ ] **Step 1: 创建 RbacModule**
- [x] **Step 1: 创建 RbacModule**
```typescript
// backend/src/rbac/rbac.module.ts
@@ -288,7 +288,7 @@ export class RbacModule implements OnModuleInit {
}
```
- [ ] **Step 2: 创建 RbacService — 种子数据方法**
- [x] **Step 2: 创建 RbacService — 种子数据方法**
`backend/src/rbac/rbac.service.ts` 中,先定义权限点常量和预设角色,然后实现 `seedData()`
@@ -451,7 +451,7 @@ export class RbacService {
}
```
- [ ] **Step 3: 实现角色 CRUD 方法**
- [x] **Step 3: 实现角色 CRUD 方法**
在同一个 `RbacService` 中追加:
@@ -495,7 +495,7 @@ export class RbacService {
}
```
- [ ] **Step 4: 实现权限查询方法**
- [x] **Step 4: 实现权限查询方法**
```typescript
async findAllPermissions(): Promise<Permission[]> {
@@ -529,7 +529,7 @@ export class RbacService {
}
```
- [ ] **Step 5: 编译验证**
- [x] **Step 5: 编译验证**
```bash
cd backend && npx tsc --noEmit
@@ -537,7 +537,7 @@ cd backend && npx tsc --noEmit
预期:无类型错误。
- [ ] **Step 6: Commit**
- [x] **Step 6: Commit**
```bash
git add backend/src/rbac/