Skip to content

Commit

Permalink
Adds PublicAccess WebHooks
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenbuckley committed Nov 19, 2023
1 parent 00f44d5 commit c6a9a61
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events.PublicAccess;

[WebhookEvent("Public Access Entry Deleted")]
public class PublicAccessEntryDeletedWebhookEvent : WebhookEventBase<PublicAccessEntryDeletedNotification>
{
public PublicAccessEntryDeletedWebhookEvent(
IWebhookFiringService webhookFiringService,
IWebhookService webHookService,
IOptionsMonitor<WebhookSettings> webhookSettings,
IServerRoleAccessor serverRoleAccessor)
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor)
{
}

public override string Alias => "publicAccessEntryDeleted";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events.PublicAccess;

[WebhookEvent("Public Access Entry Saved")]
public class PublicAccessEntrySavedWebhookEvent : WebhookEventBase<PublicAccessEntrySavedNotification>
{
public PublicAccessEntrySavedWebhookEvent(
IWebhookFiringService webhookFiringService,
IWebhookService webHookService,
IOptionsMonitor<WebhookSettings> webhookSettings,
IServerRoleAccessor serverRoleAccessor)
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor)
{
}

public override string Alias => "publicAccessEntrySaved";
}
8 changes: 8 additions & 0 deletions src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Umbraco.Cms.Core.Webhooks.Events.Media;
using Umbraco.Cms.Core.Webhooks.Events.MemberType;
using Umbraco.Cms.Core.Webhooks.Events.Package;
using Umbraco.Cms.Core.Webhooks.Events.PublicAccess;
using Umbraco.Cms.Core.Webhooks.Events.Relation;
using Umbraco.Cms.Core.Webhooks.Events.Script;
using Umbraco.Cms.Core.Webhooks.Events.Stylesheet;
Expand Down Expand Up @@ -175,6 +176,13 @@ public WebhookEventCollectionBuilder AddPackageWebhooks()
return this;
}

public WebhookEventCollectionBuilder AddPublicAccessWebhooks()
{
Append<PublicAccessEntryDeletedWebhookEvent>();
Append<PublicAccessEntrySavedWebhookEvent>();
return this;
}

public WebhookEventCollectionBuilder AddRelationWebhooks()
{
Append<RelationDeletedWebhookEvent>();
Expand Down

0 comments on commit c6a9a61

Please sign in to comment.