diff options
author | George Goldberg <george@gberg.me> | 2017-01-25 13:12:04 +0000 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-01-25 08:12:04 -0500 |
commit | a930eef71dc398fff8ce1a7fdffec8522b9c34f9 (patch) | |
tree | ef445b0077110bbf0ade543319c5d2869262c7a3 /app | |
parent | ca3e6e38e39ff899af20c57e5c447a850662405f (diff) | |
download | chat-a930eef71dc398fff8ce1a7fdffec8522b9c34f9.tar.gz chat-a930eef71dc398fff8ce1a7fdffec8522b9c34f9.tar.bz2 chat-a930eef71dc398fff8ce1a7fdffec8522b9c34f9.zip |
PLT-4858: Allow system admin to delete all channels. (#5180)
The app-package refactor means that the check for a Channel Member
object before allowing to delete the channel is now redundant, as the
check is already carried out by using HasPermissionToChannel() on the
user requesting it. As a result, System Admins can now delete channels
through the API even if they aren't members.
Diffstat (limited to 'app')
-rw-r--r-- | app/channel.go | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/app/channel.go b/app/channel.go index b8e02a149..1844e3177 100644 --- a/app/channel.go +++ b/app/channel.go @@ -243,14 +243,11 @@ func UpdateChannelMemberNotifyProps(data map[string]string, channelId string, us func DeleteChannel(channel *model.Channel, userId string) *model.AppError { uc := Srv.Store.User().Get(userId) - scm := Srv.Store.Channel().GetMember(channel.Id, userId) ihc := Srv.Store.Webhook().GetIncomingByChannel(channel.Id) ohc := Srv.Store.Webhook().GetOutgoingByChannel(channel.Id) if uresult := <-uc; uresult.Err != nil { return uresult.Err - } else if scmresult := <-scm; scmresult.Err != nil { - return scmresult.Err } else if ihcresult := <-ihc; ihcresult.Err != nil { return ihcresult.Err } else if ohcresult := <-ohc; ohcresult.Err != nil { @@ -259,7 +256,6 @@ func DeleteChannel(channel *model.Channel, userId string) *model.AppError { user := uresult.Data.(*model.User) incomingHooks := ihcresult.Data.([]*model.IncomingWebhook) outgoingHooks := ohcresult.Data.([]*model.OutgoingWebhook) - // Don't need to do anything with channel member, just wanted to confirm it exists if channel.DeleteAt > 0 { err := model.NewLocAppError("deleteChannel", "api.channel.delete_channel.deleted.app_error", nil, "") |