Revert "Revert "[MM-51274] Remove deprecated PermissionUseSlashCommands (#22819)" (#23405)" (#23463)

Automatic Merge
Этот коммит содержится в:
Amy Blais
2023-05-19 19:04:28 -04:00
коммит произвёл GitHub
родитель 9587b826c7
Коммит cfa5be4d3e
11 изменённых файлов: 10 добавлений и 43 удалений

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

@@ -329,13 +329,6 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
// For compatibility reasons, PermissionCreatePost is also checked.
// TODO: Remove in 8.0: https://mattermost.atlassian.net/browse/MM-51274
if !c.App.SessionHasPermissionToChannel(c.AppContext, *c.AppContext.Session(), commandArgs.ChannelId, model.PermissionUseSlashCommands) {
c.SetPermissionError(model.PermissionUseSlashCommands)
return
}
channel, err := c.App.GetChannel(c.AppContext, commandArgs.ChannelId)
if err != nil {
c.Err = err
@@ -354,13 +347,6 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) {
c.SetPermissionError(model.PermissionCreatePost)
return
}
// For compatibility reasons, PermissionCreatePost is also checked.
// TODO: Remove in 8.0: https://mattermost.atlassian.net/browse/MM-51274
if !c.App.SessionHasPermissionTo(*c.AppContext.Session(), model.PermissionUseSlashCommands) {
c.SetPermissionError(model.PermissionUseSlashCommands)
return
}
}
}