Use the username instead of a user when adding a user to a team or giving it rights (#76)
This commit is contained in:
@ -49,9 +49,11 @@ func (nu *NamespaceUser) Create(a web.Auth) (err error) {
|
||||
}
|
||||
|
||||
// Check if the user exists
|
||||
if _, err = GetUserByID(nu.UserID); err != nil {
|
||||
user, err := GetUserByUsername(nu.Username)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
nu.UserID = user.ID
|
||||
|
||||
// Check if the user already has access or is owner of that namespace
|
||||
// We explicitly DO NOT check for teams here
|
||||
|
Reference in New Issue
Block a user