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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user