diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-08-27 11:22:19 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-08-27 11:22:19 -0400 |
commit | e1c09605dce8441e1523abc4c830062fdd457337 (patch) | |
tree | fab3563d01c1194e8dd3d873aeb37d7dd55f3b81 /api/web_conn.go | |
parent | ea4beb7c4545e3ad6c7214a6a15ec66cc784f5ea (diff) | |
parent | 041d89b85a22b0a498a4176d0d26fd5dc84c33f9 (diff) | |
download | chat-e1c09605dce8441e1523abc4c830062fdd457337.tar.gz chat-e1c09605dce8441e1523abc4c830062fdd457337.tar.bz2 chat-e1c09605dce8441e1523abc4c830062fdd457337.zip |
Merge pull request #469 from mattermost/mm-1699
MM-1699 Refactored post handling/updating on both the client and server
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 |