Fixed user_namespace relation not working

This commit is contained in:
kolaente 2018-09-06 18:52:10 +02:00
parent 6d971c5fe1
commit 37de3ef232
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 2 deletions

View File

@ -87,8 +87,8 @@ func (n *Namespace) checkUserRights(user *User, r UserRight) bool {
exists, err := x.Select("namespaces.*").
Table("namespaces").
Join("LEFT", "users_namespace", "users_namespace.namespace_id = namespaces.id").
Where("namespaces.id = ? "+
"OR namespaces.owner_id = ? "+
Where("namespaces.id = ? AND ("+
"namespaces.owner_id = ? "+
"OR (users_namespace.user_id = ? AND users_namespace.right = ?))", n.ID, user.ID, user.ID, r).
Get(&Namespace{})