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.*").
|
||||
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{})
|
||||
|
||||
|
|
Loading…
Reference in a new issue