Copied to clipboard

Flag this post as spam?

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


  • Tony Kiernan 278 posts 341 karma points
    Oct 12, 2011 @ 18:24
    Tony Kiernan
    0

    Upgrade to 4.7.1 breaking HasAccess

    I had a razor sub menu running on my page quite happily until I had to upgrade from 4.7.0 to 4.7.1 (no biggy).  However, I'm using HasAccess to show/hide elements.  It is now giving me an error

    Error loading Razor Script Razor.cshtml
    Object reference not set to an instance of an object.

    It seems to be breaking here:

    int member = Member.CurrentMemberId();
    Boolean boo = library.HasAccess(member, item.Path);

    I've found a few things that have fallen over with the upgrade but this is confusing me (Yes, I've got @using umbraco.cms.businesslogic.member;)

  • Tony Kiernan 278 posts 341 karma points
    Oct 12, 2011 @ 18:25
    Tony Kiernan
    0

    I've output the member and path variables and these are both fine

  • Tony Kiernan 278 posts 341 karma points
    Oct 12, 2011 @ 18:58
    Tony Kiernan
    0

    I can get round this using umbraco.cms.businesslogic.web.Access, but need to create a dedault user id

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Oct 13, 2011 @ 13:34
    Dan Diplo
    0

    You should report this on Codeplex Issue Tracker for Umbraco.

  • Anthony Candaele 1197 posts 2049 karma points
    Jan 01, 2012 @ 17:56
    Anthony Candaele
    0

    I use this in my Umbraco 4.7.1 Razor navigation menu:

    if(library.HasAccess(item.Iditem.Path))


    This works fine

    I found the solution here

    greetings,

    Anthony

Please Sign in or register to post replies

Write your reply to:

Draft