summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store.go
diff options
context:
space:
mode:
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r--store/sql_user_store.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index 77ff5bfab..d19135b64 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -554,3 +554,21 @@ func (us SqlUserStore) GetTotalActiveUsersCount() StoreChannel {
return storeChannel
}
+
+func (us SqlUserStore) PermanentDelete(userId string) StoreChannel {
+
+ storeChannel := make(StoreChannel)
+
+ go func() {
+ result := StoreResult{}
+
+ if _, err := us.GetMaster().Exec("DELETE FROM Users WHERE Id = :UserId", map[string]interface{}{"UserId": userId}); err != nil {
+ result.Err = model.NewAppError("SqlUserStore.GetByEmail", "We couldn't delete the existing account", "userId="+userId+", "+err.Error())
+ }
+
+ storeChannel <- result
+ close(storeChannel)
+ }()
+
+ return storeChannel
+}