diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/convert/user.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/convert/user.go b/modules/convert/user.go index c588f5f2f0..07a4efd41a 100644 --- a/modules/convert/user.go +++ b/modules/convert/user.go @@ -25,6 +25,15 @@ func ToUser(user, doer *models.User) *api.User { return toUser(user, signed, authed) } +// ToUsers convert list of models.User to list of api.User +func ToUsers(doer *models.User, users []*models.User) []*api.User { + result := make([]*api.User, len(users)) + for i := range users { + result[i] = ToUser(users[i], doer) + } + return result +} + // ToUserWithAccessMode convert models.User to api.User // AccessMode is not none show add some more information func ToUserWithAccessMode(user *models.User, accessMode models.AccessMode) *api.User { |