diff options
Diffstat (limited to 'api/web_conn.go')
-rw-r--r-- | api/web_conn.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api/web_conn.go b/api/web_conn.go index 0990de8ef..4315f5650 100644 --- a/api/web_conn.go +++ b/api/web_conn.go @@ -121,6 +121,11 @@ func (c *WebConn) writePump() { } } +func (c *WebConn) updateChannelAccessCache(channelId string) { + allowed := hasPermissionsToChannel(Srv.Store.Channel().CheckPermissionsTo(c.TeamId, channelId, c.UserId)) + c.ChannelAccessCache[channelId] = allowed +} + func hasPermissionsToChannel(sc store.StoreChannel) bool { if cresult := <-sc; cresult.Err != nil { return false |