From f7cfa507d755ed3e7ede0f14b10c1fdbee0f4976 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Wed, 27 Feb 2013 00:41:24 +0600 Subject: [PATCH] fixed bug with attributes --- src/Umbraco.Web/Mvc/MemberAuthorizeAttribute.cs | 8 ++++++++ src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/Umbraco.Web/Mvc/MemberAuthorizeAttribute.cs b/src/Umbraco.Web/Mvc/MemberAuthorizeAttribute.cs index 29db38ade5..e0c6d16bd6 100644 --- a/src/Umbraco.Web/Mvc/MemberAuthorizeAttribute.cs +++ b/src/Umbraco.Web/Mvc/MemberAuthorizeAttribute.cs @@ -6,6 +6,7 @@ using System.Web.Security; using Umbraco.Web.Security; using umbraco.cms.businesslogic.member; using AuthorizeAttribute = System.Web.Mvc.AuthorizeAttribute; +using Umbraco.Core; namespace Umbraco.Web.Mvc { @@ -40,6 +41,13 @@ namespace Umbraco.Web.Mvc protected override bool AuthorizeCore(HttpContextBase httpContext) { + if (AllowMembers.IsNullOrWhiteSpace()) + AllowMembers = ""; + if (AllowGroup.IsNullOrWhiteSpace()) + AllowGroup = ""; + if (AllowType.IsNullOrWhiteSpace()) + AllowType = ""; + var members = new List(); foreach (var s in AllowMembers.Split(',')) { diff --git a/src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs b/src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs index 16aa4e8fb9..57b934f361 100644 --- a/src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs +++ b/src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs @@ -4,6 +4,7 @@ using System.Web; using System.Web.Http; using Umbraco.Web.Security; using umbraco.cms.businesslogic.member; +using Umbraco.Core; namespace Umbraco.Web.WebApi { @@ -38,6 +39,13 @@ namespace Umbraco.Web.WebApi protected override bool IsAuthorized(System.Web.Http.Controllers.HttpActionContext actionContext) { + if (AllowMembers.IsNullOrWhiteSpace()) + AllowMembers = ""; + if (AllowGroup.IsNullOrWhiteSpace()) + AllowGroup = ""; + if (AllowType.IsNullOrWhiteSpace()) + AllowType = ""; + var members = new List(); foreach (var s in AllowMembers.Split(',')) {