Files
qipai/docs/devlogs/2026-06-18-M02-C-RBAC与数据范围.md
2026-06-18 10:51:14 +08:00

29 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# M02-C RBAC 和数据范围
- 日期:2026-06-18
- 起始 commit`a8c2a3b`
- 工程 commit`caacc78`
- 推送校验:`HEAD == origin/main == caacc78545dcd9df05fd8844d2f83fcd95b63ed6`
- ENGINEERING_DELTA=YES
- 子阶段状态:DONE
## 工程增量
- 新增六类固定角色、权限目录、角色权限、用户角色和门店授权迁移。
- 微信用户首次/重复登录时确保租户六类角色存在,并为顾客绑定最小权限。
- `/app-api/auth/me` 返回后端计算的角色、capability 和授权门店。
- 门店授权 SQL 同时校验用户租户和门店租户。
## 验证
- `npm test`:退出码 0RBAC 仓储、capability 和租户门店约束 PASS。
- WSL MySQL 8.4.9`up → verify → down → up → verify`,29/16/27 条语句,退出码 0。
- 实测顾客最小权限、门店授权和跨租户授权拒绝。
## 影响
- 数据库迁移:`2026061805`
- API`/app-api/auth/me` 增加 access。
- 部署配置:无新增秘密。
- 下一阶段:M02-D 用户与员工管理、角色分配、禁用和审计。