We have moved to GitHub Issues
Created by Kris Janssen 22 Jun 2014, 10:20:29 Updated by Shannon Deminick 26 Jun 2017, 05:39:42
foreach (var page in CurrentPage.Children.Where("Visible && HasAccess")
Does not work in PartialViewMacropage.
Page will resolve to
DynamicPublishedContent and Children will be a
DynamicPublishedContentList and the string argument of Where() will be converted into a lambda expression by
Umbraco.Web.Dynamics.ExpressionParser<T>.Parse(...) If I understand correctly.
However, DynamicPublishedContent has no definition for something like
HasAccess() so obviously they cannot be resolved by the above Where()...
One has to resort to
Umbraco.Isprotected() but as far as I know, you cannot use them in the
Where() call because it cannot be parsed (or am I wrong?), as far as I can tell because arguments are needed for
.Where("Visible && Umbraco.MemberHasAccess(id, path)")
Nonetheless, being able to not only filter visible pages but also accessible ones from a Where() would be very convenient.
Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/
Type: Feature (request)
Backwards Compatible: True
Due in version: