MM-62500 - Apply Delete check on commands (#29896)

* apply delete check on commands, add tests

* combine tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Scott Bishel
2025-01-30 08:20:36 -07:00
коммит произвёл GitHub
родитель 1f34d784dd
Коммит f2af360401
3 изменённых файлов: 26 добавлений и 0 удалений

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

@@ -335,6 +335,11 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if channel.DeleteAt != 0 {
c.Err = model.NewAppError("createPost", "api.command.execute_command.deleted.error", nil, "", http.StatusBadRequest)
return
}
if channel.Type != model.ChannelTypeDirect && channel.Type != model.ChannelTypeGroup {
// if this isn't a DM or GM, the team id is implicitly taken from the channel so that slash commands created on
// some other team can't be run against this one