New structure (#7)
This commit is contained in:
16
pkg/models/namespace_users_update.go
Normal file
16
pkg/models/namespace_users_update.go
Normal file
@ -0,0 +1,16 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user