U7.1.4 Dynamic HasAccess() IsProtected() not working
I have a site set up (upgraded from U6.x to U7.1.4 where several pages feature role based protection.
This seems to work, trying to access these pages brings up the login dialog.
Now, I tried to modify my navigation Partial view macro to only render items that are accessible:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
<ul>
@{
var homeNode = CurrentPage.AncestorOrSelf(1);
}
<li class=""><a href="@homeNode.Url">@homeNode.Name</a></li>
@foreach (var page in CurrentPage.AncestorOrSelf(1).Children.Where("Visible"))
{
if (page.Children.Any())
...
Trying to add .Where(Visible && HasAccess) renders no nodes at all (although they are clearly in my site) .Where(Visible && !IsProtected) likewise does not work.
Sticking with .Where("Visible") instead relying on an if statement such as page.HasAccess() or page.IsProtected also does not work. These methods always seem to return nothing at all.
Is this a bug or is something wrong with my setup?
U7.1.4 Dynamic HasAccess() IsProtected() not working
I have a site set up (upgraded from U6.x to U7.1.4 where several pages feature role based protection.
This seems to work, trying to access these pages brings up the login dialog.
Now, I tried to modify my navigation Partial view macro to only render items that are accessible:
Trying to add
.Where(Visible && HasAccess)
renders no nodes at all (although they are clearly in my site).Where(Visible && !IsProtected)
likewise does not work.Sticking with
.Where("Visible")
instead relying on an if statement such aspage.HasAccess()
orpage.IsProtected
also does not work. These methods always seem to return nothing at all.Is this a bug or is something wrong with my setup?
Needless to say, this is rather urgent :s
Cheers,
Kris
A small update:
In exactly the same script does in fact yield the expected "True" or "False" values...
Anybody with an idea?
Anyone on the core team that could comment on this?
Cheers,
Kris
is working on a reply...