I have a list of nodes, some of which are public and others are private where admin will give access to it. My question is how do i get to display those list. Both list should be available when user is login.
So when am on a particular node i will display the subpages where some are private/some public.
The issue here is when am not LoggedIn am getting both Private/Public
@using umbraco.MacroEngines; @inherits umbraco.MacroEngines.DynamicNodeContext @using umbraco.cms.businesslogic.member @using System.Web.Security @{ var parent = Model.AncestorOrSelf(2); var currentUser = Member.GetCurrentMember();
if(parent !=null){ <ul> @foreach(var item in parent.Children.Where("Visible")){
List of Protected and Has:Access to
Hi everyone,
I have a list of nodes, some of which are public and others are private where admin will give access to it. My question is how do i get to display those list. Both list should be available when user is login.
So when am on a particular node i will display the subpages where some are private/some public.
The issue here is when am not LoggedIn am getting both Private/Public
That looks correct to me. I would have thought it would work for you.
Have you tried outputting the currentUser and item.HasAccess() property to check what they are returning?
e.g.
Yes i did everything turns out to be True!
What's the contents of @currentUser, or @currentUser.Name when you're not logged in?
I instead did something like this
I'm glad you got it working but it's strange that the .HasAccess() property wasn't working.
is working on a reply...