U4-5119 - Implementation of DynamicPublishedContent.HasAccess() or equivalent

Created by Kris Janssen 22 Jun 2014, 10:20:29 Updated by Shannon Deminick 26 Jun 2017, 05:39:42

Something like:

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 IsProtected() of HasAccess() so obviously they cannot be resolved by the above Where()...

One has to resort to Umbraco.MemberHasAccess() and 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 MemberHasAccess:

.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.

Comments

Shannon Deminick 26 Jun 2017, 05:39:42

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/


Priority: Normal

Type: Feature (request)

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:

Sprint:

Story Points:

Cycle: