/lists/{listID}/users now also returns the user right

This commit is contained in:
kolaente 2018-09-17 19:36:44 +02:00
parent 59361df9b2
commit b1564659c4
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -11,10 +11,14 @@ func (ul *ListUser) ReadAll(user *User) (interface{}, error) {
return nil, ErrNeedToHaveListReadAccess{} return nil, ErrNeedToHaveListReadAccess{}
} }
type userWithRight struct {
User `xorm:"extends"`
Right UserRight `json:"right"`
}
// Get all users // Get all users
all := []*User{} all := []*userWithRight{}
err = x. err = x.
Select("users.*").
Join("INNER", "users_list", "user_id = users.id"). Join("INNER", "users_list", "user_id = users.id").
Where("users_list.list_id = ?", ul.ListID). Where("users_list.list_id = ?", ul.ListID).
Find(&all) Find(&all)