Repository navigation
帳號管理:設定教學組長、教務主任;發布 v1.3.1 - #47
Merged
Merged
Conversation
使用者詢問:「行政職稱」填了教學組長,登入後仍是教師,找不到設定角色的地方。
先前畫面上只建得出安裝時的系統管理員與教師帳號。
- 新 API(限系統管理員):GET/POST /api/users、PUT /api/users/{id}/roles、
PATCH /api/users/{id}、POST /api/users/{id}/reset-password、POST /api/users/{id}/active
- 可指派教學組長/教務主任/系統管理員;教師身分由教師資料決定、不受影響,
所以組長的教師帳號加上「教學組長」即可一個帳號兩種用途
- 護欄:至少保留一個啟用中的系統管理員;不能停用自己或拿掉自己的管理員身分;
不提供刪除(停用即可,保留歷史紀錄)
- 前端:「帳號管理」頁(選單限系統管理員,路由守衛同步),預設列行政帳號、可搜尋
- 教師資料的帳號若另有行政身分,提示改為指向「帳號管理」
測試:後端 +9(663)、e2e +1(51)。手冊補上角色設定、第 10 章帳號管理與 FAQ;
同步 v1.3.1 的 CHANGELOG、README、升級指南、.env.example、路線圖、功能總覽。
沒有資料表結構變更。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
帳號管理,發 v1.3.1。
起因
使用者詢問:「行政職稱」填了教學組長,登入後仍是教師,找不到設定角色的地方。查程式後確認是系統缺口——畫面上只建得出安裝時的系統管理員,和從教師資料建立的教師帳號;教學組長、教務主任無處可設。
做法
後端(新增
app/api/users.py,全部限系統管理員)GET /api/usersPOST /api/usersPUT /api/users/{id}/rolesPATCH /api/users/{id}POST /api/users/{id}/reset-passwordPOST /api/users/{id}/active護欄:至少保留一個啟用中的系統管理員;不能停用自己、不能拿掉自己的系統管理員身分、自己的密碼不從這裡改。
前端:新頁面「帳號管理」(
/settings/accounts,選單與路由守衛皆限系統管理員)。預設列行政帳號、可切「全部帳號」並搜尋;設定身分、重設密碼、停用/啟用。頁首說明兩種常見做法:組長本身是教師 → 原帳號加上「教學組長」;另開行政帳號 → 新增帳號。視窗放在n-space外(避開 v1.2.14 的關不掉問題)。其他:教師資料的帳號若另有行政身分,原提示「請由系統管理員處理」改為指向「帳號管理」。
驗證
build_docs.py --check✓手冊補上第 0 章「角色在哪裡設定」、第 10 章「帳號管理」、FAQ「怎麼設定教學組長、教務主任的帳號?」;一併完成 v1.3.1 的版本同步。沒有資料表結構變更。 合併後打
v1.3.1標籤。🤖 Generated with Claude Code