Skip to content

Commit

Permalink
Role reset bug when changing current organization role
Browse files Browse the repository at this point in the history
  • Loading branch information
jaemyeongroh committed Dec 1, 2021
1 parent 96178ca commit 0868245
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/server/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,14 @@ func (s *Service) OrganizationUpdateUser(w http.ResponseWriter, r *http.Request)
return
}

u.Roles = roles
// change req.Roles in u.Roles
for i, existRule := range u.Roles {
for _, role := range roles {
if existRule.Organization == role.Organization {
u.Roles[i] = role
}
}
}

// If the request contains a name, it must be the same as the
// one on the user. This is particularly useful to the front-end
Expand Down

0 comments on commit 0868245

Please sign in to comment.