Copied to clipboard

Flag this post as spam?

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


  • Bex 444 posts 555 karma points
    Aug 13, 2014 @ 12:21
    Bex
    0

    Can you tell if member is currently on a protected page?

    Hi

    I am using umbraco 6.1.6.

    Although I am using the umbraco members and member groups and standard role based protection I'd like to be able to tell in code (or xslt) if a user is currently on a protected page and what role it is protected by?

    Is this possible?

    Thanks

    Bex

  • Lasse Kofoed 49 posts 177 karma points
    Aug 14, 2014 @ 10:20
    Lasse Kofoed
    100

    using umbraco.cms.businesslogic.web;
    using umbraco.NodeFactory ;

    Tells you if the page is protected
    Access.IsProtected(Node.GetCurrent().NodeId, Node.GetCurrent().Path)

    Get the groups that have access.
    var groups = Access.GetAccessingMembershipRoles(Node.GetCurrent().Id, Node.GetCurrent().Path);

Please Sign in or register to post replies

Write your reply to:

Draft