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

@@ -398,6 +398,21 @@ namespace Umbraco.Core.Services
}
}
/// <summary>
/// Assigns the same permission set for a single user to any number of entities
/// </summary>
/// <param name="userId"></param>
/// <param name="permissions"></param>
/// <param name="entityIds"></param>
public void AssignUserPermissions(int userId, IEnumerable<char> permissions, params int[] entityIds)
{
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateUserRepository(uow))
{
repository.AssignUserPermissions(userId, permissions, entityIds);
}
}
public IEnumerable<IUserType> GetAllUserTypes(params int[] ids)
{
var uow = _uowProvider.GetUnitOfWork();