From ef73e181f1d8d88b3e95ee57b34e0ec59185e25c Mon Sep 17 00:00:00 2001 From: Zeegaan <70372949+Zeegaan@users.noreply.github.com> Date: Wed, 8 Sep 2021 14:54:21 +0200 Subject: [PATCH] Implemented attribute changes in controller --- src/Umbraco.Core/Models/ContentEditing/NotificationStyle.cs | 5 ++++- .../Controllers/UmbracoAuthorizedApiController.cs | 3 +++ .../Controllers/UmbracoAuthorizedJsonController.cs | 4 +--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Core/Models/ContentEditing/NotificationStyle.cs b/src/Umbraco.Core/Models/ContentEditing/NotificationStyle.cs index aeda314f4c..a8c17d1850 100644 --- a/src/Umbraco.Core/Models/ContentEditing/NotificationStyle.cs +++ b/src/Umbraco.Core/Models/ContentEditing/NotificationStyle.cs @@ -1,5 +1,8 @@ -namespace Umbraco.Cms.Core.Models.ContentEditing +using System.Runtime.Serialization; + +namespace Umbraco.Cms.Core.Models.ContentEditing { + [DataContract] public enum NotificationStyle { /// diff --git a/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedApiController.cs b/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedApiController.cs index 826527aa1f..3d34842faf 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedApiController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedApiController.cs @@ -23,6 +23,9 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers /// is logged in using forms authentication which indicates the seconds remaining /// before their timeout expires. /// + [AngularJsonOnlyConfiguration] // TODO: This could be applied with our Application Model conventions + [JsonExceptionFilter] + [AngularJsonOnlyConfiguration] [IsBackOffice] [UmbracoUserTimeoutFilter] [Authorize(Policy = AuthorizationPolicies.BackOfficeAccess)] diff --git a/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedJsonController.cs b/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedJsonController.cs index eb082ae6e6..ca536346ae 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedJsonController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedJsonController.cs @@ -1,4 +1,4 @@ -using Umbraco.Cms.Web.BackOffice.Filters; +using Umbraco.Cms.Web.BackOffice.Filters; using Umbraco.Cms.Web.Common.Filters; namespace Umbraco.Cms.Web.BackOffice.Controllers @@ -11,8 +11,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers /// methods that are not called by Angular or don't contain a valid csrf header will NOT work. /// [ValidateAngularAntiForgeryToken] - [AngularJsonOnlyConfiguration] // TODO: This could be applied with our Application Model conventions - [JsonExceptionFilter] public abstract class UmbracoAuthorizedJsonController : UmbracoAuthorizedApiController { }