I am trying to filter the users and members tree. So if a user in Company A logs in, that user can only see other users and memebers that are part of Company A.
I thought I rember seeing a forum post that had some sample code on how to apply a filter to the tree, but after 2 hours of looking I just can't find it.
So the BaseContentTree_AfterNodeRender method is called every time a node in the tree is rendered, for the content tree, media tree, user tree, everything EXCEPT the members tree (UGHHHHHH)!
So I tried to add an event to the MemberContentTree instead of BaseTree, but all it does is add the event to the base tree and not the Member tree:
MemberContentTree.AfterNodeRender += new BaseTree.AfterNodeRenderEventHandler(MemberContentTree_AfterNodeRender);
filtering tree data for users and members
I am trying to filter the users and members tree. So if a user in Company A logs in, that user can only see other users and memebers that are part of Company A.
I thought I rember seeing a forum post that had some sample code on how to apply a filter to the tree, but after 2 hours of looking I just can't find it.
Thanks!
If anyone has any idea how to go about this it would be greatly appreciated. I'm at a point where its a show stopper for me.
Thanks!
I was able to get half way there, the filtered user tree is working, but the members tree is still a challenge.
Here is the Filtered User Tree:
using System;
using umbraco.BusinessLogic;
using umbraco.cms.presentation.Trees;
using umbraco.interfaces;
public class FilterMemberTree : IApplicationStartupHandler
{
public FilterMemberTree()
{
BaseContentTree.AfterNodeRender += new BaseTree.AfterNodeRenderEventHandler(BaseContentTree_AfterNodeRender);
}
void BaseContentTree_AfterNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
{
if (node.TreeType == "users")
{
//do custom filtering here
}
}
}
So the BaseContentTree_AfterNodeRender method is called every time a node in the tree is rendered, for the content tree, media tree, user tree, everything EXCEPT the members tree (UGHHHHHH)!
So I tried to add an event to the MemberContentTree instead of BaseTree, but all it does is add the event to the base tree and not the Member tree:
MemberContentTree.AfterNodeRender += new BaseTree.AfterNodeRenderEventHandler(MemberContentTree_AfterNodeRender);
Any ideas?
is working on a reply...