1
0

Fixed check if the user really exists before updating/deleting its rights (#77)

This commit is contained in:
konrad
2019-05-25 10:16:55 +00:00
committed by Gitea
parent 4c4eb76fed
commit 85d08e5697
5 changed files with 35 additions and 21 deletions

View File

@ -40,6 +40,13 @@ func (nu *NamespaceUser) Update() (err error) {
return err
}
// Check if the user exists
user, err := GetUserByUsername(nu.Username)
if err != nil {
return err
}
nu.UserID = user.ID
_, err = x.
Where("namespace_id = ? AND user_id = ?", nu.NamespaceID, nu.UserID).
Cols("right").