/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
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B

View File

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