Fixed caching issues on editing node permissions

This commit is contained in:
AndyButland
2016-10-30 11:58:36 +01:00
parent f316b3f694
commit 6560f38cb0
7 changed files with 143 additions and 56 deletions

View File

@@ -2,9 +2,7 @@
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Persistence.Repositories;
using umbraco.interfaces;
namespace Umbraco.Web.Cache
{
@@ -31,8 +29,6 @@ namespace Umbraco.Web.Cache
public override void RefreshAll()
{
ClearAllIsolatedCacheByEntityType<IUser>();
if (UserPermissionsCache)
UserPermissionsCache.Result.ClearCacheByKeySearch(CacheKeys.UserPermissionsCacheKey);
base.RefreshAll();
}
@@ -47,17 +43,8 @@ namespace Umbraco.Web.Cache
var userCache = ApplicationContext.Current.ApplicationCache.IsolatedRuntimeCache.GetCache<IUser>();
if (userCache)
userCache.Result.ClearCacheItem(RepositoryBase.GetCacheIdKey<IUser>(id));
if (UserPermissionsCache)
UserPermissionsCache.Result.ClearCacheByKeySearch(string.Format("{0}{1}", CacheKeys.UserPermissionsCacheKey, id));
base.Remove(id);
}
private Attempt<IRuntimeCacheProvider> UserPermissionsCache
{
get { return ApplicationContext.Current.ApplicationCache.IsolatedRuntimeCache.GetCache<EntityPermission>(); }
}
}
}

View File

@@ -60,7 +60,7 @@ namespace Umbraco.Web.Cache
private Attempt<IRuntimeCacheProvider> UserGroupPermissionsCache
{
get { return ApplicationContext.Current.ApplicationCache.IsolatedRuntimeCache.GetCache<UserGroupEntityPermission>(); }
get { return ApplicationContext.Current.ApplicationCache.IsolatedRuntimeCache.GetCache<EntityPermission>(); }
}
}
}

View File

@@ -52,7 +52,7 @@ namespace Umbraco.Web.Cache
private Attempt<IRuntimeCacheProvider> UserGroupPermissionsCache
{
get { return ApplicationContext.Current.ApplicationCache.IsolatedRuntimeCache.GetCache<UserGroupEntityPermission>(); }
get { return ApplicationContext.Current.ApplicationCache.IsolatedRuntimeCache.GetCache<EntityPermission>(); }
}
}
}