Skip to content

Commit

Permalink
#106 Fix oganization check on user update
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed May 25, 2018
1 parent 50ab549 commit 8ea207a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/org/thp/cortex/controllers/UserCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class UserCtrl @Inject() (
case _ Future.failed(AuthorizationError("You can't give superadmin right to an user"))
}
// check organization
_ if (!fields.contains("organization")) Future.successful(()) else Future.failed(AuthorizationError("You can't move an user to another organization"))
_ if (fields.getString("organization").fold(true)(_ == targetUserOrganization)) Future.successful(()) else Future.failed(AuthorizationError("You can't move an user to another organization"))
} yield ()
}

Expand Down

0 comments on commit 8ea207a

Please sign in to comment.