diff --git a/src/Umbraco.Core/Services/INotificationService.cs b/src/Umbraco.Core/Services/INotificationService.cs index 92a1e93e2f..a990b1e0ff 100644 --- a/src/Umbraco.Core/Services/INotificationService.cs +++ b/src/Umbraco.Core/Services/INotificationService.cs @@ -22,7 +22,7 @@ namespace Umbraco.Core.Services /// /// /// - void SendNotifications(IUser operatingUser, IEnumerable entities, string action, string actionName, Uri siteUri, + void SendNotifications(IUser operatingUser, IEnumerable entities, string action, string actionName, Uri siteUri, Func<(IUser user, NotificationEmailSubjectParams subject), string> createSubject, Func<(IUser user, NotificationEmailBodyParams body, bool isHtml), string> createBody); diff --git a/src/Umbraco.Core/Services/Implement/NotificationService.cs b/src/Umbraco.Core/Services/Implement/NotificationService.cs index 12e575d903..0bc2f993d7 100644 --- a/src/Umbraco.Core/Services/Implement/NotificationService.cs +++ b/src/Umbraco.Core/Services/Implement/NotificationService.cs @@ -66,17 +66,11 @@ namespace Umbraco.Core.Services.Implement /// /// /// - /// - /// Currently this will only work for Content entities! - /// - public void SendNotifications(IUser operatingUser, IEnumerable entities, string action, string actionName, Uri siteUri, + public void SendNotifications(IUser operatingUser, IEnumerable entities, string action, string actionName, Uri siteUri, Func<(IUser user, NotificationEmailSubjectParams subject), string> createSubject, Func<(IUser user, NotificationEmailBodyParams body, bool isHtml), string> createBody) { - if (entities is IEnumerable == false) - throw new NotSupportedException(); - - var entitiesL = entities as List ?? entities.Cast().ToList(); + var entitiesL = entities.ToList(); //exit if there are no entities if (entitiesL.Count == 0) return; diff --git a/src/Umbraco.Web.UI.Client/src/common/interceptors/security.interceptor.js b/src/Umbraco.Web.UI.Client/src/common/interceptors/security.interceptor.js index b636a0a51c..13d5fbc057 100644 --- a/src/Umbraco.Web.UI.Client/src/common/interceptors/security.interceptor.js +++ b/src/Umbraco.Web.UI.Client/src/common/interceptors/security.interceptor.js @@ -102,11 +102,8 @@ //It was decided to just put these messages into the normal status messages. - var msg = "Unauthorized access to URL:
" + rejection.config.url.split('?')[0] + ""; - if (rejection.config.data) { - msg += "
with data:
" + angular.toJson(rejection.config.data) + "
Contact your administrator for information."; - } - + var msg = "Unauthorized access to URL:
" + rejection.config.url.split('?')[0] + "
Contact your administrator for information."; + notificationsService.error("Authorization error", msg); } diff --git a/src/Umbraco.Web/Components/NotificationsComponent.cs b/src/Umbraco.Web/Components/NotificationsComponent.cs index f0605a7673..7eaaf0e18c 100644 --- a/src/Umbraco.Web/Components/NotificationsComponent.cs +++ b/src/Umbraco.Web/Components/NotificationsComponent.cs @@ -122,7 +122,7 @@ namespace Umbraco.Web.Components _logger = logger; } - public void Notify(IAction action, params IUmbracoEntity[] entities) + public void Notify(IAction action, params IContent[] entities) { IUser user = null; if (_umbracoContextAccessor.UmbracoContext != null) @@ -145,7 +145,7 @@ namespace Umbraco.Web.Components SendNotification(user, entities, action, _runtimeState.ApplicationUrl); } - private void SendNotification(IUser sender, IEnumerable entities, IAction action, Uri siteUri) + private void SendNotification(IUser sender, IEnumerable entities, IAction action, Uri siteUri) { if (sender == null) throw new ArgumentNullException(nameof(sender)); if (siteUri == null) throw new ArgumentNullException(nameof(siteUri));