[MM-58492] Remove subsequent check for team permissions on open channels (#27827)
* [MM-58492] Remove subsequent check for team permissions on open channels * Removed extra check for open channel for webhooks as well --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e776aa8956
Коммит
6ae03a098e
@@ -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 !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)
|
post = c.App.PreparePostForClient(c.AppContext, post, false, false, true)
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ func createIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
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.LogAudit("fail - bad channel permissions")
|
||||||
c.SetPermissionError(model.PermissionReadChannelContent)
|
c.SetPermissionError(model.PermissionReadChannelContent)
|
||||||
return
|
return
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user