Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Aug 16, 2017 @ 01:08
    Tom
    0

    Umb 7 - member is null when logged in in PublicAccessServiceExtensions HasAccess ActiveDirectoryProvider

    Hi All I have this in an inline cshtml macro inside a master page.. we're porting a project from v4 -> v7 and don't have the time to convert everything to razor..

    I'm using an ActiveDirectoryMembershipProvider

    I previously had item.HasAccess in an inline macro but this doesn't work.. I was wondering what it needs to be now? and where would you generally find this kind of information?

    I'm trying:

    var helper = new UmbracoHelper(UmbracoContext.Current);
            foreach (var c in content)
            {
                if (helper.IsProtected(c.Path) && helper.MemberHasAccess(c.Path))
                    yield return c;
            }
    

    but

    in the PublicAccessService Line 78: var roles = roleProvider.GetRolesForUser(member.UserName);

    member is null even though they are successfully logged in. The extension method called is going to:

    public static bool HasAccess(this IPublicAccessService publicAccessService, string path, MembershipUser member, RoleProvider roleProvider) line 73 of the PublicAccessServiceExtensions even though it isn't being called with that method sig and the call stack jumps me right there

Please Sign in or register to post replies

Write your reply to:

Draft