diff --git a/server/channels/api4/post.go b/server/channels/api4/post.go index 718b84b1a8..d41f58e3f2 100644 --- a/server/channels/api4/post.go +++ b/server/channels/api4/post.go @@ -572,9 +572,7 @@ func getPostsByIds(c *Context, w http.ResponseWriter, r *http.Request) { } if !c.App.SessionHasPermissionToReadChannel(c.AppContext, *c.AppContext.Session(), channel) { - if channel.Type != model.ChannelTypeOpen || (channel.Type == model.ChannelTypeOpen && !c.App.SessionHasPermissionToTeam(*c.AppContext.Session(), channel.TeamId, model.PermissionReadPublicChannel)) { - continue - } + continue } post = c.App.PreparePostForClient(c.AppContext, post, false, false, true) diff --git a/server/channels/api4/webhook.go b/server/channels/api4/webhook.go index b305140baa..8f3c47b4d8 100644 --- a/server/channels/api4/webhook.go +++ b/server/channels/api4/webhook.go @@ -51,7 +51,7 @@ func createIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) { return } - if channel.Type != model.ChannelTypeOpen && !c.App.SessionHasPermissionToReadChannel(c.AppContext, *c.AppContext.Session(), channel) { + if !c.App.SessionHasPermissionToReadChannel(c.AppContext, *c.AppContext.Session(), channel) { c.LogAudit("fail - bad channel permissions") c.SetPermissionError(model.PermissionReadChannelContent) return