Skip to content

Commit

Permalink
Bug fixed: remove other orgs when a role changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
snetsystems committed Dec 3, 2021
1 parent 96178ca commit 76f42c8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/server/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,8 @@ func (s *Service) OrganizationUpdateUser(w http.ResponseWriter, r *http.Request)
return
}

ctx := serverContext(r.Context())
// ctx := serverContext(r.Context())
ctx := r.Context()
idStr := httprouter.GetParamFromContext(ctx, "id")
id, err := strconv.ParseUint(idStr, 10, 64)
if err != nil {
Expand All @@ -682,7 +683,8 @@ func (s *Service) OrganizationUpdateUser(w http.ResponseWriter, r *http.Request)
return
}

roles, err := s.validRoles(ctx, req.Roles, u.Roles)
serverCtx := serverContext(ctx)
roles, err := s.validRoles(serverCtx, req.Roles, u.Roles)
if err != nil {
invalidData(w, err, s.Logger)
return
Expand Down
29 changes: 29 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,13 @@
hoist-non-react-statics "^3.3.0"
redux "^4.0.0"

"@types/react-resizable@^1.7.3":
version "1.7.4"
resolved "https://registry.yarnpkg.com/@types/react-resizable/-/react-resizable-1.7.4.tgz#8138e370338511b480ad00267d4efdd217f45741"
integrity sha512-+xsGkd+Gvb9+8mLR1EyhNN8kBRJcsT1uJF4WpkFpFPIoApX2S89BmJA2RVtMdkhwe6YxV4RbHfaJ3bIdcgHc7g==
dependencies:
"@types/react" "*"

"@types/react-router-redux@4":
version "4.0.52"
resolved "https://registry.yarnpkg.com/@types/react-router-redux/-/react-router-redux-4.0.52.tgz#f8d0f21ac8b8c1b65532ad25e4fad9b29271e47a"
Expand Down Expand Up @@ -2079,6 +2086,13 @@
"@types/react" "*"
redux "^3.7.2"

"@types/redux@^3.3.1":
version "3.6.0"
resolved "https://registry.yarnpkg.com/@types/redux/-/redux-3.6.0.tgz#f1ebe1e5411518072e4fdfca5c76e16e74c1399a"
integrity sha1-8evh5UEVGAcuT9/KXHbhbnTBOZo=
dependencies:
redux "*"

"@types/stack-utils@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff"
Expand Down Expand Up @@ -10097,6 +10111,14 @@ react-resizable@^1.10.0:
prop-types "15.x"
react-draggable "^4.0.3"

react-resizable@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/react-resizable/-/react-resizable-3.0.4.tgz#aa20108eff28c52c6fddaa49abfbef8abf5e581b"
integrity sha512-StnwmiESiamNzdRHbSSvA65b0ZQJ7eVQpPusrSmcpyGKzC0gojhtO62xxH6YOBmepk9dQTBi9yxidL3W4s3EBA==
dependencies:
prop-types "15.x"
react-draggable "^4.0.3"

react-resize-detector@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/react-resize-detector/-/react-resize-detector-2.3.0.tgz#57bad1ae26a28a62a2ddb678ba6ffdf8fa2b599c"
Expand Down Expand Up @@ -10351,6 +10373,13 @@ redux-thunk@^1.0.3:
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-1.0.3.tgz#778aa0099eea0595031ab6b39165f6670d8d26bd"
integrity sha1-d4qgCZ7qBZUDGrazkWX2Zw2NJr0=

redux@*:
version "4.1.2"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.1.2.tgz#140f35426d99bb4729af760afcf79eaaac407104"
integrity sha512-SH8PglcebESbd/shgf6mii6EIoRM0zrQyjcuQ+ojmfxjTtE0z9Y8pa62iA/OJ58qjP6j27uyW4kUF4jl/jd6sw==
dependencies:
"@babel/runtime" "^7.9.2"

redux@^3.3.1, redux@^3.6.0, redux@^3.7.1, redux@^3.7.2:
version "3.7.2"
resolved "https://registry.yarnpkg.com/redux/-/redux-3.7.2.tgz#06b73123215901d25d065be342eb026bc1c8537b"
Expand Down

0 comments on commit 76f42c8

Please sign in to comment.