/namepspaces/{namespacesID}/users now also returns the user right

This commit is contained in:
kolaente 2018-09-17 19:39:14 +02:00
parent b1564659c4
commit cf6577445d
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 6 additions and 7 deletions

View File

@ -18,3 +18,8 @@ type ListUser struct {
func (ListUser) TableName() string {
return "users_list"
}
type userWithRight struct {
User `xorm:"extends"`
Right UserRight `json:"right"`
}

View File

@ -11,11 +11,6 @@ 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 := []*userWithRight{}
err = x.

View File

@ -12,9 +12,8 @@ func (un *NamespaceUser) ReadAll(user *User) (interface{}, error) {
}
// Get all users
all := []*User{}
all := []*userWithRight{}
err = x.
Select("users.*").
Join("INNER", "users_namespace", "user_id = users.id").
Where("users_namespace.namespace_id = ?", un.NamespaceID).
Find(&all)