Skip to content

Commit

Permalink
#1606 Refuse to delete case if user is not in owner organisation
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Mar 17, 2021
1 parent 23446ca commit 45c3528
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions thehive/app/org/thp/thehive/services/CaseSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ class CaseSrv @Inject() (
.flatMap {
case share if share.owner =>
get(`case`).shares.toSeq.toTry(s => shareSrv.unshareCase(s._id)).map(_ => get(`case`).remove())
case share =>
shareSrv.unshareCase(share._id)
case _ =>
throw BadRequestError("Your organisation must be owner of the case")
// shareSrv.unshareCase(share._id)
}
.map(_ => auditSrv.`case`.delete(`case`, organisation, Some(details)))
}
Expand Down

0 comments on commit 45c3528

Please sign in to comment.