Commit Graph
3 Commits
Author SHA1 Message Date
kongkx c2dec1e711 fix(sid): harden admin assignment flow 2026-09-08 13:01:41 +08:00
kongkxandClaude Fable 5 46056ae4b0 feat(auth): wire permission gating through menu, routes and actions
The store's can()/useCan() helpers existed but were unused. Now:
- src/auth/permissions.ts PERM catalog mirrors backend keys
- every nav item carries a permission; sidebar filter reuses can()
- requirePermission() beforeLoad guard on all child routes (direct URLs
  redirect home when the session lacks the key)
- useCan() hides/disables mutation buttons: moderation actions,
  retranslate, robot-author edit/pause, category + locale CRUD, and the
  reserved-SID assign path (admin:sid:override hint)
- 403 responses toast 无权限执行此操作; can() unit tests added

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-12 06:42:31 +08:00
kongkx 36df03baad feat(system): SID rules/lucky-numbers/assign, locales CRUD, devices list, robot session tokens 2026-07-07 22:23:21 +08:00