MM-11520: Make entity ID checks consistent across api4. (#9395)
* MM-11520: Make entity ID checks consistent across api4. * Update tests.
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
83a00ae925
Коммит
fdbb6de3d5
@@ -583,6 +583,12 @@ func updateUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// The user being updated in the payload must be the same one as indicated in the URL.
|
||||
if user.Id != c.Params.UserId {
|
||||
c.SetInvalidParam("user_id")
|
||||
return
|
||||
}
|
||||
|
||||
if !c.App.SessionHasPermissionToUser(c.Session, user.Id) {
|
||||
c.SetPermissionError(model.PERMISSION_EDIT_OTHER_USERS)
|
||||
return
|
||||
|
||||
Ссылка в новой задаче
Block a user