Updates the BulkInsertRecords method to optionally close the trans - shouldn't by default. Updates how permissions are handled in the new services and exposes another method, ensures it's all wrapped in trans and ensures that cache is cleared properly. Fixes: U4-4213 "Replace child node permissions" does not work if all permissions cleared

This commit is contained in:
Shannon
2014-02-17 17:45:59 +11:00
parent 4d2d9156ba
commit feefb052fd
17 changed files with 232 additions and 181 deletions

View File

@@ -2,8 +2,10 @@ using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
using Umbraco.Core;
using Umbraco.Core.Events;
using umbraco.DataLayer;
using umbraco.cms.businesslogic;
@@ -170,7 +172,7 @@ namespace umbraco.BusinessLogic
}
private static string Converter(int from)
{
return from.ToString();
return from.ToString(CultureInfo.InvariantCulture);
}
/// <summary>
@@ -189,16 +191,11 @@ namespace umbraco.BusinessLogic
[MethodImpl(MethodImplOptions.Synchronized)]
public static void UpdateCruds(User user, CMSNode node, string permissions)
{
// delete all settings on the node for this user
//false = do not raise events
DeletePermissions(user, node, false);
ApplicationContext.Current.Services.UserService.AssignUserPermissions(
user.Id,
permissions.ToCharArray(),
node.Id);
// Loop through the permissions and create them
foreach (char c in permissions)
{
//false = don't raise events since we'll raise a custom event after
MakeNew(user, node, c, false);
}
OnUpdated(new UserPermission(user, node, permissions.ToCharArray()), new SaveEventArgs());
}