[MM-51401] Add an extra check for the schema (#22531)

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Konstantinos Pittas
2023-04-13 11:00:55 +03:00
коммит произвёл GitHub
родитель 53ed2ce461
Коммит 40349cddd4
2 изменённых файлов: 38 добавлений и 0 удалений

Просмотреть файл

@@ -117,6 +117,11 @@ func createTeam(c *Context, w http.ResponseWriter, r *http.Request) {
}
}
if team.SchemeId != nil && !c.App.SessionHasPermissionTo(*c.AppContext.Session(), model.PermissionSysconsoleWriteUserManagementPermissions) {
c.SetPermissionError(model.PermissionSysconsoleWriteUserManagementPermissions)
return
}
rteam, err := c.App.CreateTeamWithUser(c.AppContext, &team, c.AppContext.Session().UserId)
if err != nil {
c.Err = err