If anyone else needs this to work , I copied the Umbraco MemberAuthorizeAttribute code to create a CustomMemberAuthorizeAttribute and changed the HandleUnauthorizedRequest to set the filterContext rather than throw an exception
protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
{
filterContext.Result = new HttpStatusCodeResult(403);
//throw new HttpException(403, "Resource restricted: either member is not logged on or is not of a permitted type or group.");
}
MemberAuthorize attribute throws 500 error in Views not a 403 error
Is there any reason that it throws a HttpException with a 500 status rather than a 403 error?
mmm, seems it does return a 403, however if it is a Html.RenderAction in a view the view errors with a 500 error :(
If anyone else needs this to work , I copied the Umbraco MemberAuthorizeAttribute code to create a CustomMemberAuthorizeAttribute and changed the HandleUnauthorizedRequest to set the filterContext rather than throw an exception
is working on a reply...