Copied to clipboard

Flag this post as spam?

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


  • Mike Chambers 621 posts 1203 karma points c-trib
    Apr 28, 2015 @ 14:52
    Mike Chambers
    0

    hasAccess causing database calls??

    Having updated a site to umb 6.2.5 I've started to use mini profiler.. and seeing lots of database calls for my menu builders.. investigation reveals that any call to HasAccess seems to cause a database hit... is that normal? Shouldn't front end this just be hitting the unbraco.config and access.config files?

    Here's what I've tried. Any pointers?

    foreach (var item in Model.Children)
            {
                if (Umbraco.Web.UmbracoHelper.MemberHasAccess(item.Id, item.Path))
                {
                    @item.Name <br />
                }
            } 
    foreach (var item in Model.Children)
            {
                if(item.HasAccess())
                {
                    @item.Name <br />
                }
            }
    foreach (var item in Model.Children.Where("hasAccess")
            {
                    @item.Name <br />
             
            }

     

  • 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