Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Apr 13, 2023
1 parent 387ce0b commit 8d04581
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,12 @@ export class AlertsClient {
}

public async removeCaseIdFromAlerts({ caseId, alerts }: RemoveCaseIdFromAlertsOptions) {
/**
* We intentionally do not perform any authorization
* on the alerts. Users should be able to remove
* cases from alerts when deleting a case or an
* attachment
*/
try {
if (alerts.length === 0) {
return;
Expand Down Expand Up @@ -891,6 +897,12 @@ export class AlertsClient {
}

public async removeCaseIdsFromAllAlerts({ caseIds }: { caseIds: string[] }) {
/**
* We intentionally do not perform any authorization
* on the alerts. Users should be able to remove
* cases from alerts when deleting a case or an
* attachment
*/
try {
if (caseIds.length === 0) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@ export default ({ getService }: FtrProviderContext): void => {
});

it('should delete case ID from the alert schema when the user does NOT have access to the alert', async () => {
/**
* The alerts client throws an expectation failed error (471) when
* the user is unauthorized to find alerts for any rule types
*/

await createCaseAttachAlertAndDeleteCase({
supertest: supertestWithoutAuth,
totalCases: 1,
Expand Down

0 comments on commit 8d04581

Please sign in to comment.