test(permission): add forceSetPwd permission test

This commit is contained in:
hexxa 2022-02-23 18:23:46 +08:00 committed by Hexxa
parent d2d269171d
commit 731e4029c9
2 changed files with 86 additions and 53 deletions

View file

@ -53,6 +53,16 @@ func (cl *SingleUserClient) SetPwd(oldPwd, newPwd string, token *http.Cookie) (*
End()
}
func (cl *SingleUserClient) ForceSetPwd(userID, newPwd string, token *http.Cookie) (*http.Response, string, []error) {
return cl.r.Patch(cl.url("/v1/users/pwd/force-set")).
Send(multiusers.ForceSetPwdReq{
ID: userID,
NewPwd: newPwd,
}).
AddCookie(token).
End()
}
func (cl *SingleUserClient) SetUser(ID uint64, role string, quota *userstore.Quota, token *http.Cookie) (*http.Response, string, []error) {
return cl.r.Patch(cl.url("/v1/users/")).
Send(multiusers.SetUserReq{