Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ulrich Wagner Gade Ebsen 110 posts 238 karma points
    Jun 07, 2014 @ 10:58
    Ulrich Wagner Gade Ebsen
    0

    Trouble with Umbraco.MemberHasAccess...

    Hi, 

    I using umbraco 7.1.4 and have some issues with members and login.

    When not logged in Umbraco.MemberHasAccess(page.Id,page.Url) works as expected when iterating through a collection of nodes, but when a user is logged in,  I get the folloiwing error:

     

    Exception Details: System.FormatException: Input string was not in a correct format.

    Source Error: 

    Line 22:                 }
    Line 23: 
    Line 24:                 @Umbraco.MemberHasAccess(page.Id,page.Url)
    Line 25:                 
    Line 26:             }


    Stack Trace: 

    [FormatException: Input string was not in a correct format.]
       System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14281985
       System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +305
       umbraco.cms.businesslogic.web.Access.IsProtectedInternal(Int32 DocumentId, String Path) +262
       umbraco.cms.businesslogic.web.Access.IsProtected(Int32 DocumentId, String Path) +135
       Umbraco.Web.UmbracoHelper.MemberHasAccess(Int32 nodeId, String path) +28
       ASP._Page_Views_ClassList_cshtml.Execute() in u:\umbraco websites\umbracoInSero\umbracoInSero\Views\ClassList.cshtml:24
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +125
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +181
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +140
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +380
       System.Web.Mvc.<>c__DisplayClass1a.b__17() +33
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +263
       System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +720
       System.Web.Mvc.<>c__DisplayClass1d.b__19() +40
       System.Web.Mvc.Async.<>c__DisplayClass1.b__0() +15
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
       System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +15
       System.Web.Mvc.<>c__DisplayClass8.b__3(IAsyncResult asyncResult) +42
       System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +15
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
    

    The user is member of a group that has access to a protected page in the collection. 

    I'm using the built in login snippet. Am I missing something??

     

    /ulrich

  • Alain 73 posts 520 karma points c-trib
    Jun 18, 2014 @ 14:53
    Alain
    1

    Hi ulrich,

    Have you tried  @Umbraco.MemberHasAccess(page.id, page.path) ?

     

  • Craig Cronin 303 posts 502 karma points
    Mar 05, 2015 @ 00:14
    Craig Cronin
    0

    Alain, this just fixed it for me :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies