Have a current issue where we need to check permissions of a node in the tree (uForum) we have the node Id. We know that umbraco.library.hasaccess exists but this requires a path parameter.
Our current work around attempts to generate the path and then call the above function, code shown below.
private static page GetPage(int docId) {
var nodeFromId = umbraco.library.GetXmlNodeById(docId.ToString());
if (nodeFromId != null) { var CurrentxmlNode = (System.Xml.IHasXmlNode)nodeFromId.Current;
if (CurrentxmlNode != null) { var node = CurrentxmlNode.GetNode(); if (node != null) return new page(node); } }
return null; }
public static string GetPath(int docId) { var p = GetPage(docId); List<string> ids = new List<string>(); ids.Add(p.PageID.ToString());
Document path from a document id (v4.5)
Hello,
Have a current issue where we need to check permissions of a node in the tree (uForum) we have the node Id. We know that umbraco.library.hasaccess exists but this requires a path parameter.
Our current work around attempts to generate the path and then call the above function, code shown below.
This is currenty failing for a Uforum node on the snippet below.
Any help would be appreciated.
If you're working with published content (I'm assuming you do), you'd better use
and from there, use HasAccess as you'd normally do.
Cheers,
/Dirk
is working on a reply...