summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 7248db5337..f019475298 100644
--- a/models/user.go
+++ b/models/user.go
@@ -235,6 +235,12 @@ func (u *User) GetEmail() string {
return u.Email
}
+// GetAllUsers returns a slice of all users found in DB.
+func GetAllUsers() ([]*User, error) {
+ users := make([]*User, 0)
+ return users, x.OrderBy("id").Find(&users)
+}
+
// APIFormat converts a User to api.User
func (u *User) APIFormat() *api.User {
if u == nil {