diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index c2b8d8c38e..54f02ff004 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -141,7 +141,6 @@ - diff --git a/src/Umbraco.Web/WebApi/Filters/OverridableAuthorizationAttribute.cs b/src/Umbraco.Web/WebApi/Filters/OverridableAuthorizationAttribute.cs deleted file mode 100644 index 243611cca0..0000000000 --- a/src/Umbraco.Web/WebApi/Filters/OverridableAuthorizationAttribute.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Linq; -using System.Web.Http; -using System.Web.Http.Controllers; - -namespace Umbraco.Web.WebApi.Filters -{ - // TODO: remove this since we don't need it, see notes in EnableOverrideAuthorizationAttribute - - /// - /// Abstract auth filter class that can be used to enable overriding class auth filters at the action level - /// - /// - /// To enable a class auth filter to be overridden by an action auth filter the EnableOverrideAuthorizationAttribute can be applied - /// to the class. - /// - public abstract class OverridableAuthorizationAttribute : AuthorizeAttribute - { - /// - /// If the controller has an EnabledOverrideAuthorizationAttribute attribute specified and the action has any AuthorizeAttribute - /// specified then use the action's auth attribute instead of this one - /// - /// The context. - /// The context parameter is null. - public override void OnAuthorization(HttpActionContext actionContext) - { - if (actionContext == null) throw new ArgumentNullException("actionContext"); - - var actionAttributes = actionContext.ActionDescriptor.GetCustomAttributes(); - - //if 'this' authorize attribute exists in the current collection then continue as per normal... this is because 'this' attribute instance - // is obviously assigned at an Action level and therefore it's already executing - - if (actionAttributes.Any(x => Equals(x, this))) - { - base.OnAuthorization(actionContext); - return; - } - - //if the controller is allowing authorization to be overridden at the action level and there are action level authorization attributes - // then exit and let the action level auth attribute(s) execute. - - if (actionContext.ActionDescriptor.ControllerDescriptor.GetCustomAttributes().Any() - && actionAttributes.Any()) - { - return; - } - - base.OnAuthorization(actionContext); - } - } -}