-
Notifications
You must be signed in to change notification settings - Fork 2.9k
V15: Notification Hub #17776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
V15: Notification Hub #17776
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
6ba5c3a
Initial stab at how this could look
nikolajlauridsen 10f506e
Merge branch 'v15/dev' into v15/feature/notification-hub
nikolajlauridsen 797096d
Authorization PoC wip
nikolajlauridsen b87620d
Add connection manager
nikolajlauridsen 4eb89da
Add DI to its own class
nikolajlauridsen 28a9dd6
Use enum instead of string
nikolajlauridsen f274ed4
Use groups
nikolajlauridsen 367121f
Refactor group management into its own service
nikolajlauridsen a48a803
Update a users groups when it's saved
nikolajlauridsen fd10921
Add saved events
nikolajlauridsen 3b3b0ad
Wire up deleted notifications
nikolajlauridsen 3afc18a
Ensure update date and create date is the same
nikolajlauridsen 5a9c8c2
Cleanup
nikolajlauridsen 0f2e4b8
Minor cleanup
nikolajlauridsen 0a66ee5
Remove unusued usings
nikolajlauridsen cb61209
Move route to constant
nikolajlauridsen 8f2c62d
Add docstrings to server event router
nikolajlauridsen d9f4a09
Fix and suppress warnings
nikolajlauridsen 01402bb
Merge branch 'v15/dev' into v15/feature/notification-hub
nikolajlauridsen 668efea
Refactor to authorizer pattern
nikolajlauridsen d8612ff
Update EventType
nikolajlauridsen a1f44fb
Merge branch 'v15/dev' into v15/feature/notification-hub
nikolajlauridsen 55173f3
Remove unused enums
nikolajlauridsen d2a7d4b
Add trashed events
nikolajlauridsen cfba4ee
Notify current user that they've been updated
nikolajlauridsen 3ca273d
Add broadcast
nikolajlauridsen 9eb86de
Add ServerEventRouterTests
nikolajlauridsen c49950e
Add ServerEventUserManagerTests
nikolajlauridsen 9da85ad
Merge branch 'v15/dev' into v15/feature/notification-hub
nikolajlauridsen 2649825
Use TimeProvider
nikolajlauridsen d204c9f
Remove principal null check
nikolajlauridsen e0f9fec
Don't assign event type
nikolajlauridsen a4e8bbc
Minor cleanup
nikolajlauridsen 6018245
Rename AuthorizedEventSources
nikolajlauridsen 614a6bc
Change permission for relations
nikolajlauridsen 591b088
Exctract event authorization into its own service
nikolajlauridsen 588ad98
Add some tests
nikolajlauridsen e97d1f5
Update name
nikolajlauridsen b691fc8
Add forgotten file
nikolajlauridsen 5a9bb59
Rmember to add to DI
nikolajlauridsen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
src/Umbraco.Cms.Api.Management/DependencyInjection/ServerEventExtensions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| using System.Text.Json.Serialization; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using Umbraco.Cms.Api.Management.ServerEvents; | ||
| using Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
| using Umbraco.Cms.Core.DependencyInjection; | ||
| using Umbraco.Cms.Core.Notifications; | ||
| using Umbraco.Cms.Core.ServerEvents; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.DependencyInjection; | ||
|
|
||
| internal static class ServerEventExtensions | ||
| { | ||
| internal static IUmbracoBuilder AddServerEvents(this IUmbracoBuilder builder) | ||
| { | ||
| builder.Services.AddSingleton<IUserConnectionManager, UserConnectionManager>(); | ||
| builder.Services.AddSingleton<IServerEventRouter, ServerEventRouter>(); | ||
| builder.Services.AddSingleton<IServerEventUserManager, ServerEventUserManager>(); | ||
| builder.Services.AddSingleton<IServerEventAuthorizationService, ServerEventAuthorizationService>(); | ||
| builder.AddNotificationAsyncHandler<UserSavedNotification, UserConnectionRefresher>(); | ||
|
|
||
| builder | ||
| .AddEvents() | ||
| .AddAuthorizers(); | ||
|
|
||
| return builder; | ||
| } | ||
|
|
||
| private static IUmbracoBuilder AddEvents(this IUmbracoBuilder builder) | ||
| { | ||
| builder.AddNotificationAsyncHandler<ContentSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<ContentTypeSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MediaSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MediaTypeSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MemberSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MemberTypeSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MemberGroupSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<DataTypeSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<LanguageSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<ScriptSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<StylesheetSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<TemplateSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<DictionaryItemSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<DomainSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<PartialViewSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<PublicAccessEntrySavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<RelationSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<RelationTypeSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<UserGroupSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<UserSavedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<WebhookSavedNotification, ServerEventSender>(); | ||
|
|
||
| builder.AddNotificationAsyncHandler<ContentDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<ContentTypeDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MediaDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MediaTypeDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MemberDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MemberTypeDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MemberGroupDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<DataTypeDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<LanguageDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<ScriptDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<StylesheetDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<TemplateDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<DictionaryItemDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<DomainDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<PartialViewDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<PublicAccessEntryDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<RelationDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<RelationTypeDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<UserGroupDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<UserDeletedNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<WebhookDeletedNotification, ServerEventSender>(); | ||
|
|
||
| builder.AddNotificationAsyncHandler<ContentMovedToRecycleBinNotification, ServerEventSender>(); | ||
| builder.AddNotificationAsyncHandler<MediaMovedToRecycleBinNotification, ServerEventSender>(); | ||
|
|
||
| return builder; | ||
| } | ||
|
|
||
| private static IUmbracoBuilder AddAuthorizers(this IUmbracoBuilder builder) | ||
| { | ||
| builder.EventSourceAuthorizers() | ||
| .Append<DocumentEventAuthorizer>() | ||
| .Append<DocumentTypeEventAuthorizer>() | ||
| .Append<MediaEventAuthorizer>() | ||
| .Append<MediaTypeEventAuthorizer>() | ||
| .Append<MemberEventAuthorizer>() | ||
| .Append<MemberGroupEventAuthorizer>() | ||
| .Append<MemberTypeEventAuthorizer>() | ||
| .Append<DataTypeEventAuthorizer>() | ||
| .Append<LanguageEventAuthorizer>() | ||
| .Append<ScriptEventAuthorizer>() | ||
| .Append<StylesheetEventAuthorizer>() | ||
| .Append<TemplateEventAuthorizer>() | ||
| .Append<DictionaryItemEventAuthorizer>() | ||
| .Append<DomainEventAuthorizer>() | ||
| .Append<PartialViewEventAuthorizer>() | ||
| .Append<PublicAccessEntryEventAuthorizer>() | ||
| .Append<RelationEventAuthorizer>() | ||
| .Append<RelationTypeEventAuthorizer>() | ||
| .Append<UserGroupEventAuthorizer>() | ||
| .Append<UserEventAuthorizer>() | ||
| .Append<WebhookEventAuthorizer>(); | ||
| return builder; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/DataTypeEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class DataTypeEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public DataTypeEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.DataType]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessDataTypes; | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/DictionaryItemEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class DictionaryItemEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public DictionaryItemEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.DictionaryItem]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessDictionary; | ||
| } |
17 changes: 17 additions & 0 deletions
17
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/DocumentEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class DocumentEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public DocumentEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.Document]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessDocuments; | ||
| } | ||
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/DocumentTypeEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class DocumentTypeEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public DocumentTypeEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.DocumentType]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessDocumentTypes; | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/DomainEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class DomainEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public DomainEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.Domain]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessDocuments; | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/LanguageEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class LanguageEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public LanguageEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.Language]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessLanguages; | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/MediaEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class MediaEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public MediaEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.Media]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessMediaOrMediaTypes; | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/MediaTypeEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class MediaTypeEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public MediaTypeEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.MediaType]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessMediaTypes; | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/MemberEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class MemberEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public MemberEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.Member]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessMembersOrMemberTypes; | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/MemberGroupEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class MemberGroupEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public MemberGroupEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.MemberGroup]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessMemberGroups; | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Cms.Api.Management/ServerEvents/Authorizers/MemberTypeEventAuthorizer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Umbraco.Cms.Core; | ||
| using Umbraco.Cms.Web.Common.Authorization; | ||
|
|
||
| namespace Umbraco.Cms.Api.Management.ServerEvents.Authorizers; | ||
|
|
||
| public class MemberTypeEventAuthorizer : EventSourcePolicyAuthorizer | ||
| { | ||
| public MemberTypeEventAuthorizer(IAuthorizationService authorizationService) : base(authorizationService) | ||
| { | ||
| } | ||
|
|
||
| public override IEnumerable<string> AuthorizableEventSources => [Constants.ServerEvents.EventSource.MemberType]; | ||
|
|
||
| protected override string Policy => AuthorizationPolicies.TreeAccessMemberTypes; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.