Fixed user_namespace relation not working
This commit is contained in:
parent
6d971c5fe1
commit
37de3ef232
1 changed files with 2 additions and 2 deletions
|
@ -87,8 +87,8 @@ func (n *Namespace) checkUserRights(user *User, r UserRight) bool {
|
||||||
exists, err := x.Select("namespaces.*").
|
exists, err := x.Select("namespaces.*").
|
||||||
Table("namespaces").
|
Table("namespaces").
|
||||||
Join("LEFT", "users_namespace", "users_namespace.namespace_id = namespaces.id").
|
Join("LEFT", "users_namespace", "users_namespace.namespace_id = namespaces.id").
|
||||||
Where("namespaces.id = ? "+
|
Where("namespaces.id = ? AND ("+
|
||||||
"OR namespaces.owner_id = ? "+
|
"namespaces.owner_id = ? "+
|
||||||
"OR (users_namespace.user_id = ? AND users_namespace.right = ?))", n.ID, user.ID, user.ID, r).
|
"OR (users_namespace.user_id = ? AND users_namespace.right = ?))", n.ID, user.ID, user.ID, r).
|
||||||
Get(&Namespace{})
|
Get(&Namespace{})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue