From d96842af92a96d626471df1695c9969bec969d36 Mon Sep 17 00:00:00 2001 From: To-om Date: Thu, 4 Mar 2021 11:36:04 +0100 Subject: [PATCH] #1803 Fix user deletion when user is in several organisations --- thehive/app/org/thp/thehive/services/UserSrv.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thehive/app/org/thp/thehive/services/UserSrv.scala b/thehive/app/org/thp/thehive/services/UserSrv.scala index 5467de2dea..dcf8255262 100644 --- a/thehive/app/org/thp/thehive/services/UserSrv.scala +++ b/thehive/app/org/thp/thehive/services/UserSrv.scala @@ -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()