summaryrefslogtreecommitdiffstats
path: root/app/authorization.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-10-04 11:42:38 -0400
committerGitHub <noreply@github.com>2017-10-04 11:42:38 -0400
commitfadd9514f6e71590aba781a7035e1de4150137b0 (patch)
treea265d44f377281abd56baf31fe878e08f90f7d4b /app/authorization.go
parentfa80cb10a8ad047f9504c49ed2671d31650d1878 (diff)
downloadchat-fadd9514f6e71590aba781a7035e1de4150137b0.tar.gz
chat-fadd9514f6e71590aba781a7035e1de4150137b0.tar.bz2
chat-fadd9514f6e71590aba781a7035e1de4150137b0.zip
PLT-7718 Patch for files (#7564)
* Patch for files * Fix merge * Fix tests * Fix another test
Diffstat (limited to 'app/authorization.go')
-rw-r--r--app/authorization.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/authorization.go b/app/authorization.go
index ae5c7c3b3..01180e8d8 100644
--- a/app/authorization.go
+++ b/app/authorization.go
@@ -4,6 +4,7 @@
package app
import (
+ "net/http"
"strings"
l4g "github.com/alecthomas/log4go"
@@ -50,6 +51,8 @@ func (a *App) SessionHasPermissionToChannel(session model.Session, channelId str
channel, err := a.GetChannel(channelId)
if err == nil && channel.TeamId != "" {
return SessionHasPermissionToTeam(session, channel.TeamId, permission)
+ } else if err != nil && err.StatusCode == http.StatusNotFound {
+ return false
}
return SessionHasPermissionTo(session, permission)