diff options
Diffstat (limited to 'api4/channel.go')
-rw-r--r-- | api4/channel.go | 5 |
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 |