Copied to clipboard

Flag this post as spam?

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


  • Ian 23 posts 113 karma points
    Oct 06, 2016 @ 17:50
    Ian
    0

    IsProtectedByMembershipRole for v7 ?

    Hi all

    I'm trying to find out which member groups/roles are used to protect a protected content node.

    I know there used to be a method "IsProtectedByMembershipRole" which took the role as a string.

    But the v7 reference doco at https://our.umbraco.org/documentation/Reference/Querying/UmbracoHelper/

    doesn't seem to have anything like it anymore.

    Anyone know if such a method exists in v7 or if there is another way to find out which roles protect a given content node?

    Many thanks in adv!

    Ian

  • Jo Kendal 32 posts 194 karma points
    Oct 12, 2016 @ 15:40
    Jo Kendal
    0

    Correct me if I'm wrong but isn't that up to you to set on the node properties?

    i.e. Do Something Else > Public Access > Role Based Protection

  • Ian 23 posts 113 karma points
    Dec 09, 2016 @ 10:08
    Ian
    0

    Hi Jo

    yes of course its up to the content editors to set role-based protection.

    But my code needs to determine the roles protecting a given node at run-time.

    Hope that's clear!

    ps. from memory I think I got round the issue using a combination of: Umbraco.MemberIsLoggedOn, Members.GetCurrentMember, Umbraco.IsProtected, Umbraco.MemberHasAccess

Please Sign in or register to post replies

Write your reply to:

Draft