Try our conversational search powered by Generative AI!

Hide items in EditTree

Vote:
 
Is it possible in some way to hide pages in the edit page tree based on permissions? If a user does not have permissions to edit a page I would like it to be hidden for that user. /Mattias
#15839
Oct 24, 2007 8:31
Vote:
 
At this moment there is no support for this feature. It is however a pretty common request and has been on the "feature request" list for sometime. So it is not unlikely that it will be implemented in the future.
#16463
Oct 24, 2007 16:12
Vote:
 
Ok, so there is absolutely no way I can do this? I played with the user control pageexplorer.ascx and hoped there was an event I could tap into. I found PageTreeViewItemDataBound but realized I cannot modify the PageTreeNode collection at that point. No other ideas, ugly or clean, of how this can be solved? /Mattias
#16464
Oct 24, 2007 17:05
Vote:
 
You can try the following code, works for me. :D //Create an event-handle for FinishedLoadingChildren, when the item in the tress are loaded, but not rendered yet. EPiServer.DataFactory.Instance.FinishedLoadingChildren += new ChildrenEventHandler(Instance_FinishedLoadingChildren); if (HttpContext.Current.Request.Url.ToString().StartsWith(EPiServer.Configuration.Settings.Instance.UIUrl.ToString())) { if (e.PageLink == PageReference.RootPage) //applies from RootPage { int pageId = 123; // for (int i = e.Children.Count - 1; i >= 0; i--) { //Try to hide the page id = 123 by removing it from the collection if (e.Children[i].PageLink.ID == pageId) { e.Children.RemoveAt(i); break; } } } }
#16465
Oct 29, 2007 14:54
Vote:
 
Thank you very much! Works like a charm. /Mattias
#16466
Nov 07, 2007 9:40
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.