Copied to clipboard

Flag this post as spam?

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


  • Sasha Kruglyak 10 posts 97 karma points
    Sep 07, 2014 @ 08:57
    Sasha Kruglyak
    0

    set node public access programmatically

    Hi all,

     

    I'm trying to set public access node programmatically, but i can't find rigth method to do this.

    I'm creating node (for example "organization"), for each organization node i create Member Group, and now I would like to set for this node public access only for this Member Group.

    Only one example i saw using : umbraco.cms.businesslogic.web.Access.AddMemberGroupToDocument - but this method is obsolete,

    if there any another umbraco method to set node public access?

     

    Thanks all.

  • MK 429 posts 905 karma points
    Sep 07, 2014 @ 12:56
    MK
    101

    Try this:

     

                Access.ProtectPage(false, nodeId, loginId, errorId);

                Access.AddMembershipRoleToDocument(nodeId, memberGroupName);

  • Sasha Kruglyak 10 posts 97 karma points
    Sep 07, 2014 @ 13:37
    Sasha Kruglyak
    0

    Wow, great,

    Its work,

    Thank u!

Please Sign in or register to post replies

Write your reply to:

Draft