Skip to content

Commit

Permalink
#1803 Fix user deletion when user is in several organisations
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Mar 4, 2021
1 parent 1d27581 commit d96842a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/services/UserSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class UserSrv @Inject() (

def delete(user: User with Entity, organisation: Organisation with Entity)(implicit graph: Graph, authContext: AuthContext): Try[Unit] = {
if (get(user).organisations.filterNot(_.get(organisation._id)).exists)
get(user).role.filterNot(_.organisation.get(organisation._id)).remove()
get(user).role.filter(_.organisation.get(organisation._id)).remove()
else {
get(user).role.remove()
get(user).remove()
Expand Down

0 comments on commit d96842a

Please sign in to comment.