summaryrefslogtreecommitdiffstats
path: root/api4/channel.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2018-07-07 12:04:18 -0400
committerJoramWilander <jwawilander@gmail.com>2018-07-07 12:04:18 -0400
commitb78b216a3c8eb354085f97f33dac5e7661ac9188 (patch)
treedc7a253730a684bc6744c0b0bf36a87944242583 /api4/channel.go
parent359f12db33d45b6ffade0872ddf3652a5c52f4a8 (diff)
parent9e5ec7d09d4c51e278f17f25fb6c0f3484b50a3b (diff)
downloadchat-b78b216a3c8eb354085f97f33dac5e7661ac9188.tar.gz
chat-b78b216a3c8eb354085f97f33dac5e7661ac9188.tar.bz2
chat-b78b216a3c8eb354085f97f33dac5e7661ac9188.zip
Merge branch 'master' into plugins-2
Diffstat (limited to 'api4/channel.go')
-rw-r--r--api4/channel.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/api4/channel.go b/api4/channel.go
index cb9112677..1afadf39b 100644
--- a/api4/channel.go
+++ b/api4/channel.go
@@ -638,6 +638,11 @@ func deleteChannel(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ if channel.Type == model.CHANNEL_DIRECT || channel.Type == model.CHANNEL_GROUP {
+ c.Err = model.NewAppError("deleteChannel", "api.channel.delete_channel.type.invalid", nil, "", http.StatusBadRequest)
+ return
+ }
+
if channel.Type == model.CHANNEL_OPEN && !c.App.SessionHasPermissionToChannel(c.Session, channel.Id, model.PERMISSION_DELETE_PUBLIC_CHANNEL) {
c.SetPermissionError(model.PERMISSION_DELETE_PUBLIC_CHANNEL)
return