chore: check off Task 5 (RbacController)

This commit is contained in:
2026-07-02 11:44:41 +08:00
parent 2f793833eb
commit 2541ff8d9e
2 changed files with 7 additions and 7 deletions

View File

@@ -1004,7 +1004,7 @@ git commit -m "feat(rbac): integrate RbacService into AuthService login, update
- Consumes: `RbacService` (Task 2), `JwtAuthGuard` (existing), `@RequirePermission` (Task 3)
- Produces: REST API endpoints for roles, permissions, and user management
- [ ] **Step 1: 创建 DTO**
- [x] **Step 1: 创建 DTO**
```typescript
// backend/src/rbac/dto/rbac.dto.ts
@@ -1078,7 +1078,7 @@ export class ResetPasswordDto {
}
```
- [ ] **Step 2: 创建 RbacController**
- [x] **Step 2: 创建 RbacController**
```typescript
// backend/src/rbac/rbac.controller.ts
@@ -1225,7 +1225,7 @@ export class RbacController {
}
```
- [ ] **Step 3: 在 RbacService 中补充用户管理方法**
- [x] **Step 3: 在 RbacService 中补充用户管理方法**
`backend/src/rbac/rbac.service.ts` 中追加:
@@ -1299,7 +1299,7 @@ export class RbacController {
}
```
- [ ] **Step 4: 编译验证**
- [x] **Step 4: 编译验证**
```bash
cd backend && npx tsc --noEmit
@@ -1307,7 +1307,7 @@ cd backend && npx tsc --noEmit
预期:无类型错误。
- [ ] **Step 5: Commit**
- [x] **Step 5: Commit**
```bash
git add backend/src/rbac/

View File

@@ -13,7 +13,7 @@
- [x] 2.2 实现角色 CRUD含权限关联创建角色时同时写入 RolePermission更新时删除旧关联重建
- [x] 2.3 实现 getUserPermissions 方法:通过 User→UserRole→Role→RolePermission→Permission 链查询,去重后返回权限 code 列表
- [x] 2.4 实现 getPermissionTree 方法:返回按 group 分组的权限树,供前端权限一览和管理页使用
- [ ] 2.5 创建 RbacController角色 CRUD + 权限树 + 用户-角色分配接口,所有接口加 @RequirePermission 守卫
- [x] 2.5 创建 RbacController角色 CRUD + 权限树 + 用户-角色分配接口,所有接口加 @RequirePermission 守卫
## 3. 权限守卫实现
@@ -36,7 +36,7 @@
- [ ] 4.9 ClassroomRentalsController全部方法加 @RequirePermission
- [ ] 4.10 DashboardController全部方法加 @RequirePermission
- [ ] 4.11 OperationLogsController全部方法加 @RequirePermission
- [ ] 4.12 AuthController用户管理部分分离为用户管理接口@RequirePermission;移除原 register 接口的旧逻辑
- [x] 4.12 AuthController用户管理部分分离为用户管理接口@RequirePermission;移除原 register 接口的旧逻辑
## 5. 前端权限基础设施