summaryrefslogtreecommitdiffstats
path: root/api/channel.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2016-12-22 20:44:37 +0000
committerChristopher Speller <crspeller@gmail.com>2016-12-22 15:44:37 -0500
commitca61b4bed94ea98530bf4f1b2f7585fe86ef80cd (patch)
treeb9f9c42a8ad6d125b7d21adcd386a7f7c0d9a73a /api/channel.go
parent03e1d0aac3746c89d56284e5eea52b7a363d0e05 (diff)
downloadchat-ca61b4bed94ea98530bf4f1b2f7585fe86ef80cd.tar.gz
chat-ca61b4bed94ea98530bf4f1b2f7585fe86ef80cd.tar.bz2
chat-ca61b4bed94ea98530bf4f1b2f7585fe86ef80cd.zip
PLT-5080 (Server): Channel-Admin level permissions (#4874)
Adds permissions for manage/delete public/private channels at the Channel Admin level.
Diffstat (limited to 'api/channel.go')
-rw-r--r--api/channel.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/channel.go b/api/channel.go
index 7ccf5e2b6..44efc5efb 100644
--- a/api/channel.go
+++ b/api/channel.go
@@ -804,11 +804,11 @@ func deleteChannel(c *Context, w http.ResponseWriter, r *http.Request) {
// Allow delete if user is the only member left in channel
if memberCount > 1 {
- if channel.Type == model.CHANNEL_OPEN && !HasPermissionToTeamContext(c, channel.TeamId, model.PERMISSION_DELETE_PUBLIC_CHANNEL) {
+ if channel.Type == model.CHANNEL_OPEN && !HasPermissionToChannelContext(c, channel.Id, model.PERMISSION_DELETE_PUBLIC_CHANNEL) {
return
}
- if channel.Type == model.CHANNEL_PRIVATE && !HasPermissionToTeamContext(c, channel.TeamId, model.PERMISSION_DELETE_PRIVATE_CHANNEL) {
+ if channel.Type == model.CHANNEL_PRIVATE && !HasPermissionToChannelContext(c, channel.Id, model.PERMISSION_DELETE_PRIVATE_CHANNEL) {
return
}
}