补充分组管理入口和创建权限校验
Security Checks / security (push) Waiting to run

允许管理员通过成员管理能力打开分组操作,并限制创建账号时的分组范围。
This commit is contained in:
xuans committed 2026-10-02 03:51:11 +08:00
1 parent b7a1e44dc6
commit 6df4d7a49e
2 files changed
+8 -3

No files matched your search

+4
View File
@@ -132,6 +132,10 @@ func CreateUser(ctx *context.Context, w http.ResponseWriter, req *http.Request)
writeAccountGroupError(w, err)
return
}
if err := accountgroup.CheckWrite(tx, accountgroup.MembershipScopeGuard(ctx.UserID, ctx.EffectiveRole(), groupIDs)); err != nil {
writeAccountGroupError(w, err)
return
}
groupIDs, err = accountgroup.ValidateMembership(tx, user.EffectiveRole(), groupIDs)
if err != nil {
writeAccountGroupError(w, err)