I am looking at using GetDescendantNodes(Func<Node, bool>) in a /base class but not sure to write for Func<Node, bool> to return nodes that a member has access to.
You can use a lambda expression for the Func. The params for the Func are the source and result, so for this you have an Node input (source) and the output needs to be a bool.
Try something like this...
var currentNode = umbraco.presentation.nodeFactory.Node.GetCurrent();
var nodesMemberHasAccessTo = new System.Collections.Generic.List<int>() { 1111, 2222, 3333, 4444 };
var nodes = currentNode.GetDescendantNodes(n => nodesMemberHasAccessTo.Contains(n.Id));
Obviously I'm not sure how you are specifying the nodes that the member can have access to - hence using the generic list of ids.
GetDescendantNodes(Func<Node, bool>)
I am looking at using GetDescendantNodes(Func<Node, bool>) in a /base class but not sure to write for Func<Node, bool> to return nodes that a member has access to.
Any ideas?
Hi Sean,
You can use a lambda expression for the Func. The params for the Func are the source and result, so for this you have an Node input (source) and the output needs to be a bool.
Try something like this...
Obviously I'm not sure how you are specifying the nodes that the member can have access to - hence using the generic list of ids.
Cheers, Lee.
is working on a reply...