Take view archived config into account on users and posts api endpoints (#19014)
* Take view archived config into account on users and posts api endpoints * Move the inChannel check to the top level
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8588f69850
Коммит
009d02c57a
12
api4/post.go
12
api4/post.go
@@ -182,6 +182,18 @@ func getPostsForChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if !*c.App.Config().TeamSettings.ExperimentalViewArchivedChannels {
|
||||
channel, err := c.App.GetChannel(channelId)
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
}
|
||||
if channel.DeleteAt != 0 {
|
||||
c.Err = model.NewAppError("Api4.getPostsForChannel", "api.user.view_archived_channels.get_posts_for_channel.app_error", nil, "", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var list *model.PostList
|
||||
var err *model.AppError
|
||||
etag := ""
|
||||
|
||||
Ссылка в новой задаче
Block a user