Fixes issue with broken caches used for user permissions

Calculating start nodes is expensive and this is supposed to be cached but the cache was not working.
This commit is contained in:
Shannon
2021-02-09 13:43:28 +11:00
parent febb15445a
commit 3b3d55ca26
33 changed files with 325 additions and 220 deletions

View File

@@ -47,7 +47,7 @@ namespace Umbraco.Web.Trees
private int[] _userStartNodes;
protected override int[] UserStartNodes
=> _userStartNodes ?? (_userStartNodes = Security.CurrentUser.CalculateContentStartNodeIds(Services.EntityService));
=> _userStartNodes ?? (_userStartNodes = Security.CurrentUser.CalculateContentStartNodeIds(Services.EntityService, AppCaches));
public ContentTreeController(UmbracoTreeSearcher treeSearcher, ActionCollection actions, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
{
@@ -165,7 +165,7 @@ namespace Umbraco.Web.Trees
}
//if the user has no path access for this node, all they can do is refresh
if (!Security.CurrentUser.HasContentPathAccess(item, Services.EntityService))
if (!Security.CurrentUser.HasContentPathAccess(item, Services.EntityService, AppCaches))
{
var menu = new MenuItemCollection();
menu.Items.Add(new RefreshNode(Services.TextService, true));