4 Commits

Author SHA1 Message Date
liuyun
127707ffde feat(rbac): 批量删除 + 数据权限自定义闭环 + 若干修复
- users/orgs/resources 新增 POST /batch-delete(事务 + 失败汇总 + 用户踢下线)
- 角色数据权限自定义:GET/PUT /roles/:roleCode/orgs(roleOrg 写入路径)
- assignResources 校验 resourceCodes 存在性;角色 :id 语义改 :roleCode
- createTenant 补 createdBy;登录锁定双层阈值(IP+用户名 / 用户名全局)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 17:42:05 +08:00
liuyun
537ec4fd91 feat(rbac): 数据权限扩展至组织树与审计/登录日志
- orgs: 列表按可见部门过滤
- audit-logs/login-logs: 按操作人所属部门过滤(self 按 userId/username)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 16:24:51 +08:00
liuyun
7340658305 feat: enforce RBAC, audit/login logging, and seed script
收口 Phase 0 三处「声明未生效」:
- 三级鉴权落地:权限集存 Redis(key 前缀隔离多项目),@RequirePermissions 挂到全部受控接口,super_admin 角色绕过权限码与 data_scope
- 审计/登录日志自动落库:@AuditLog 装饰器 + 拦截器异步写入(写操作+登录登出),登录成功/失败均记 login_log(脱敏)
- seed 脚本:一键初始化租户 touyun/用户 touyun/超管 super_admin/全量资源树(48 资源全量授权)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 23:19:41 +08:00
liuyun
d8d3055c73 feat: backend foundation (Prisma 6 + MySQL, auth, tenant/soft-delete/data-scope filters, core CRUD)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 21:13:35 +08:00