Copied to clipboard

Flag this post as spam?

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


  • Dan 1288 posts 3921 karma points c-trib
    May 10, 2013 @ 18:29
    Dan
    0

    How to get nodes a member has access to, programatically

    Hi,

    I have a usercontrol in a 4.7.1 site.  I have a starting node id and a currently-logged-in member.  I want to return all of the child nodes of the starting node to which the member has access permissions.

    Could anyone suggest how this can be done, as I can't find this type of thing in the documentation?

    Thanks!

  • Dan 1288 posts 3921 karma points c-trib
    May 13, 2013 @ 12:38
    Dan
    100

    I don't know if this is the best way but here's how I solved this, for the record:

    List permittedParentNodeIds = new List();
    foreach (Node childNode in node.Children)
    {
        var child = childNode;
        if (umbraco.library.HasAccess(child.Id, child.Path) == true)
        {
            permittedParentNodeIds.Add(child.Id.ToString());
        }
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft