From 03c6dcbd865e2af2db5db150189504bfa493ae2e Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Sun, 15 Nov 2015 18:18:02 -0800 Subject: PLT-975 adding perm deletes --- store/sql_channel_store.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'store/sql_channel_store.go') diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index a9f99bd67..65e2cc45d 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -616,6 +616,23 @@ func (s SqlChannelStore) RemoveMember(channelId string, userId string) StoreChan return storeChannel } +func (s SqlChannelStore) DeleteMember(userId string) StoreChannel { + storeChannel := make(StoreChannel) + + go func() { + result := StoreResult{} + + if _, err := s.GetMaster().Exec("DELETE FROM ChannelMembers WHERE UserId = :UserId", map[string]interface{}{"UserId": userId}); err != nil { + result.Err = model.NewAppError("SqlChannelStore.RemoveMember", "We couldn't remove the channel member", "user_id="+userId+", "+err.Error()) + } + + storeChannel <- result + close(storeChannel) + }() + + return storeChannel +} + func (s SqlChannelStore) CheckPermissionsTo(teamId string, channelId string, userId string) StoreChannel { storeChannel := make(StoreChannel) -- cgit v1.2.3-1-g7c22