Skip to content

Commit

Permalink
#1732 Add API for observable deletion from an alert
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jan 7, 2021
1 parent 458de0e commit 762ead3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class ObservableCtrl @Inject() (
observable <-
observableSrv
.get(EntityIdOrName(observableId))
.can(Permissions.manageObservable)
.canManage
.getOrFail("Observable")
_ <- observableSrv.remove(observable)
} yield Results.NoContent
Expand Down
1 change: 1 addition & 0 deletions thehive/app/org/thp/thehive/controllers/v0/Router.scala
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class Router @Inject() (
case POST(p"/alert/$alertId/artifact") => observableCtrl.createInAlert(alertId) // Audit ok
case PATCH(p"/alert/artifact/$observableId") => observableCtrl.update(observableId) // Audit ok
case PATCH(p"/alert/artifact/_bulk") => observableCtrl.bulkUpdate // Audit ok
case DELETE(p"/alert/artifact/$observableId") => observableCtrl.delete(observableId) // Audit ok

case GET(p"/case") => caseCtrl.search
case POST(p"/case") => caseCtrl.create // Audit ok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class ObservableCtrl @Inject() (
observable <-
observableSrv
.get(EntityIdOrName(observableId))
.can(Permissions.manageObservable)
.canManage
.getOrFail("Observable")
_ <- observableSrv.remove(observable)
} yield Results.NoContent
Expand Down

0 comments on commit 762ead3

Please sign in to comment.