summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-05 17:33:45 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-05 17:33:45 -0700
commite26b77faf10c6ca18f12df573d36d4e4676ffcf9 (patch)
tree37dfcaba9f6f3047d4a2c1baec8dc6070cc3af0e /store/sql_user_store.go
parentda61bb38ff04b4e93d952b37aae02fa43360aa49 (diff)
downloadchat-e26b77faf10c6ca18f12df573d36d4e4676ffcf9.tar.gz
chat-e26b77faf10c6ca18f12df573d36d4e4676ffcf9.tar.bz2
chat-e26b77faf10c6ca18f12df573d36d4e4676ffcf9.zip
PLT-518 check for security bulletins
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r--store/sql_user_store.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index 0a723d965..f82f87290 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -370,6 +370,37 @@ func (us SqlUserStore) GetProfiles(teamId string) StoreChannel {
return storeChannel
}
+func (us SqlUserStore) GetSystemAdminProfiles() StoreChannel {
+
+ storeChannel := make(StoreChannel)
+
+ go func() {
+ result := StoreResult{}
+
+ var users []*model.User
+
+ if _, err := us.GetReplica().Select(&users, "SELECT * FROM Users WHERE Roles = :Roles", map[string]interface{}{"Roles": "system_admin"}); err != nil {
+ result.Err = model.NewAppError("SqlUserStore.GetSystemAdminProfiles", "We encounted an error while finding user profiles", err.Error())
+ } else {
+
+ userMap := make(map[string]*model.User)
+
+ for _, u := range users {
+ u.Password = ""
+ u.AuthData = ""
+ userMap[u.Id] = u
+ }
+
+ result.Data = userMap
+ }
+
+ storeChannel <- result
+ close(storeChannel)
+ }()
+
+ return storeChannel
+}
+
func (us SqlUserStore) GetByEmail(teamId string, email string) StoreChannel {
storeChannel := make(StoreChannel)