Restrict Access To Custom Tree's Via Users Group (Not Via Attribute)
I have a section with custom tree's, and I want to restrict access to certain trees to backoffice users in certain groups. The groups that are decided are configurable and come from a config file (So I can't just write them in the tree attribute).
Looking at the docs it says to use the TreeNodesRendering or RootNodeRendering event. However when you grab the user
sender.Security.CurrentUser
Firstly it's obsolete? Secondly I can't get the groups? I can get everything I need by doing the following
var ticket = new HttpContextWrapper(HttpContext.Current).GetUmbracoAuthTicket();
However, I don't want to new up a HttpContextWrapper on every single node render? Am I missing something? Is there an easier way to do what I'm trying to achieve?
Restrict Access To Custom Tree's Via Users Group (Not Via Attribute)
I have a section with custom tree's, and I want to restrict access to certain trees to backoffice users in certain groups. The groups that are decided are configurable and come from a config file (So I can't just write them in the tree attribute).
Looking at the docs it says to use the TreeNodesRendering or RootNodeRendering event. However when you grab the user
Firstly it's obsolete? Secondly I can't get the groups? I can get everything I need by doing the following
However, I don't want to new up a HttpContextWrapper on every single node render? Am I missing something? Is there an easier way to do what I'm trying to achieve?
is working on a reply...