Skip to content

Commit

Permalink
adding IT for admin editting someone else's comment
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Toepker <[email protected]>
  • Loading branch information
toepkerd-zz committed Oct 1, 2024
1 parent 3b6d97d commit 1084528
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,27 @@ class SecureAlertingCommentsRestApiIT : AlertingRestTestCase() {
}
}

fun `test admin can edit someone else's comment`() {
createUserWithRoles(
userA,
listOf(ALERTING_FULL_ACCESS_ROLE),
listOf(),
false
)

val monitor = createRandomMonitor(refresh = true)
val alert = createAlert(randomAlert(monitor).copy(state = Alert.State.ACTIVE))
val alertId = alert.id
val commentContent = "test comment"

val commentId = createAlertComment(alertId, commentContent, userAClient!!).id

val updatedContent = "updated comment"
updateAlertComment(commentId, updatedContent, client())

deleteRoleMapping(ALERTING_FULL_ACCESS_ROLE)
}

// TODO: this will cause security ITs to fail because the getSystemIndexDescriptors() change
// introduced will not yet be consumed by Security plugin to allow this test to pass.
// Will uncomment this in a later PR once Security plugin has consumed the getSystemIndexDescriptors()
Expand Down

0 comments on commit 1084528

Please sign in to comment.