Copied to clipboard

Flag this post as spam?

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


  • Dan 1250 posts 3747 karma points admin c-trib
    Jan 27, 2010 @ 14:06
    Dan
    0

    List all pages a member can edit

    Hi,

    I have several protected folders, each is protected so that only a single member group can access them.  However, when a member logs in there's no way of them knowing where they can go (as the navigation for their permitted content obviously isn't public).

    So how can I present a list of nodes which are editable by the member currently signed in?  Ideally I'd like to embed this as a macro on the log-in page, so that when the member is logged in they're given direct links to their private content.

    Thanks all...

  • Dan 1250 posts 3747 karma points admin c-trib
    Jan 27, 2010 @ 14:17
    Dan
    0

    Sorry, the title of this post should read: list all pages a member can view (not edit)!

  • Tommy Poulsen 514 posts 708 karma points
    Jan 27, 2010 @ 14:24
    Tommy Poulsen
    0

    Hi Dan, you may be able to use the umbraco.library methods HasAccess and IsProtected.

    This snippet by Drobar is from an old thread:

    <ul>
        <xsl:for-each select="$source/node [
                string(data [@alias='umbracoNaviHide']) != '1'
                and (umbraco.library:IsProtected(@id, @path) = false()
                    or umbraco.library:HasAccess(@id, @path) = true())
                ]">
            <li>
                <a href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:value-of select="@nodeName"/>
                </a>
            </li>
        </xsl:for-each>
    </ul>
  • Dan 1250 posts 3747 karma points admin c-trib
    Jan 27, 2010 @ 15:26
    Dan
    0

    HasAccess is the one, thanks very much Tommy!

  • mark 2 posts 22 karma points
    Nov 21, 2012 @ 17:51
    mark
    0

    Would you please post the definition of $source? In other words, there must have been a statement something like: <xsl:variable name="member" select="umbraco.library:GetCurrentMember()" />

    cheers

    mark.

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Nov 21, 2012 @ 23:27
    Chriztian Steinmeier
    0

    Hi Mark,

    $source in this context is just a node somewhere in the tree (e.g. the Home node).

    The code just makes sure that IF a document is protected, to check that the currently logged in member has access to the document.

    Not: The XSLT above was written for the "legacy XML Schema" and won't work in a newer Umbraco install - here is a version of the XSLT for the new (default since 4.5.2) Schema:

    <ul>
        <xsl:for-each select="$source/*[@isDoc][not(umbracoNaviHide = 1)]
            [ not(umbraco.library:IsProtected(@id, @path))
               or umbraco.library:HasAccess(@id, @path)   ]">
            <li>
                <a href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:value-of select="@nodeName" />
                </a>
            </li>
        </xsl:for-each>
    </ul>

     

    /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