vikunja-api/pkg/models/namespace_users_update.go
2018-10-31 12:42:38 +00:00

16 lines
331 B
Go

package models
// Update updates a user <-> namespace relation
func (nu *NamespaceUser) Update() (err error) {
// Check if the right is valid
if err := nu.Right.isValid(); err != nil {
return err
}
_, err = x.
Where("namespace_id = ? AND user_id = ?", nu.NamespaceID, nu.UserID).
Cols("right").
Update(nu)
return
}