From bbb5cd24c8a6543d384097c0e06353d76ab34de2 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Thu, 18 Aug 2022 16:46:16 +0200 Subject: [PATCH] Added actions events for integrations and webhooks refs https://github.com/TryGhost/Toolbox/issues/356 - this allows Ghost to collect CRUD events for integrations and webhooks, to eventually be shown in the audit log --- ghost/core/core/server/models/integration.js | 3 +++ ghost/core/core/server/models/webhook.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ghost/core/core/server/models/integration.js b/ghost/core/core/server/models/integration.js index bad3d00d32..f4da47e5d5 100644 --- a/ghost/core/core/server/models/integration.js +++ b/ghost/core/core/server/models/integration.js @@ -6,6 +6,9 @@ const {NoPermissionError} = require('@tryghost/errors'); const Integration = ghostBookshelf.Model.extend({ tableName: 'integrations', + actionsCollectCRUD: true, + actionsResourceType: 'integration', + relationships: ['api_keys', 'webhooks'], relationshipBelongsTo: { diff --git a/ghost/core/core/server/models/webhook.js b/ghost/core/core/server/models/webhook.js index 63a5d13461..e907029758 100644 --- a/ghost/core/core/server/models/webhook.js +++ b/ghost/core/core/server/models/webhook.js @@ -7,6 +7,9 @@ let Webhooks; Webhook = ghostBookshelf.Model.extend({ tableName: 'webhooks', + actionsCollectCRUD: true, + actionsResourceType: 'webhook', + defaults() { return { api_version: `v${ghostVersion.safe}`,