9 Commits
Author SHA1 Message Date
stevenlee87 6c19aefc71 feat(roles): sort user list by role rank and username
优化 GET /api/roles/users 用户列表的排序:
- 主排序:按角色等级 皇帝 → 公爵 → 骑士 → 平民(无角色用户排最后)
- 次排序:用户名长度(短者优先)
- 末排序:用户名字母序(大小写不敏感)
- 查询由 db.query.users.findMany(relational)改为显式 select + leftJoin,
  以支持基于角色名的 CASE 排序

Sort the user list returned by GET /api/roles/users:
- Primary: by role rank Emperor -> Duke -> Knight -> Civilian (users
  without a role sort last)
- Secondary: username length (shorter first)
- Tertiary: username alphabetical order (case-insensitive)
- Switch the query from db.query.users.findMany (relational) to an explicit
  select + leftJoin to enable CASE-based ordering on role name
2026-07-30 22:09:33 +08:00
stevenlee87 4960395777 refactor: favicon 移回 app/ + 删除用户改为 RESTful DELETE /api/users/[id]
- favicon: 从 public/favicon.ico 移回 app/favicon.ico(next-on-pages 1.13.16 下生产验证 /favicon.ico 正常返回)
- 删除用户: POST /api/roles/delete 改为 DELETE /api/users/[id],符合 RESTful 语义(资源 users + 标准 DELETE 方法)
2026-07-30 22:09:33 +08:00
stevenlee87 d34bb3d474 feat(roles): add delete user functionality to role management
Add ability for Emperor to delete users from the role management panel:
- New POST /api/roles/delete endpoint with PROMOTE_USER permission guard,
  blocks deleting self or other emperors, cascades user data cleanup
- Trash button on each non-emperor row with confirmation dialog
- Auto-navigate to previous page when deleting the last user on a page
- i18n strings added for all 5 locales
2026-07-30 22:09:33 +08:00
lidong-sal 6fc9686be9 feat(roles): enhance role management panel with user list and inline editing
Redesign the Emperor's Role Management panel from a single-user
search-and-assign form into a full user management dashboard with
browsable user list and inline role editing.
2026-07-30 22:09:33 +08:00
beilunyang 9ad3115833 feat: Implement OpenAPI with API Key authentication and role-based access control 2025-02-10 11:25:25 +08:00
beilunyang 086ad28f6a feat: Support finding and promoting roles by username 2025-01-15 19:34:35 +08:00
beilunyang bfe439f90b refactor: support demotion and improve error handling in role management 2024-12-28 18:23:44 +08:00
beilunyang fbd65a5ee4 feat: Enhance role management by adding role assignment functionality and checks for existing roles 2024-12-28 17:50:47 +08:00
beilunyang 5a7c17752a feat: Implement role-based access control and enhance permissions system 2024-12-27 13:35:29 +08:00