/lists/{listID}/users now also returns the user right
This commit is contained in:
parent
59361df9b2
commit
b1564659c4
1 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue