Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 886 posts 2415 karma points
    Oct 03, 2012 @ 14:11
    Claushingebjerg
    0

    Count accessible subnodes

    Im trying to count protected subnodes which are accessible to a given member.

    <xsl:value-of select="count(./* [@isDoc] [umbraco.library:HasAccess(@id, @path) = true()])"/>

    Returns alle nodes, not just the one accessible to the member...

     

    How do i count only the ones acceesible?

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Oct 03, 2012 @ 22:59
    Chriztian Steinmeier
    0

    Hi Claus,

    Reading what you expect - you seem to expect *only* the node the member has access to (but maybe forgetting that he has anonymous access to the others - or am I not getting this right?)

    Try combining with IsProtected() so you're only counting the protected nodes that the member has access to:

    <xsl:variable name="accessibleNodes" select="count(*[@isDoc][umbraco.library:IsProtected(@id, @path) and umbraco.library:HasAccess(@id, @path)])" />

     

    /Chriztian 

  • 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