[MM-21359] Add extra permission check when updating an OAuth app (#13445)
* Add permission check * Add additional check in tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f75c8c7c9f
Коммит
7a6c0f607b
@@ -87,6 +87,10 @@ func updateOAuthApp(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if !c.App.SessionHasPermissionTo(c.App.Session, model.PERMISSION_MANAGE_SYSTEM) {
|
||||
oauthApp.IsTrusted = oldOauthApp.IsTrusted
|
||||
}
|
||||
|
||||
updatedOauthApp, err := c.App.UpdateOauthApp(oldOauthApp, oauthApp)
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
|
||||
Ссылка в новой задаче
Block a user