Merge remote-tracking branch 'netcore/dev' into netcore/netcore

This commit is contained in:
Bjarke Berg
2020-08-26 08:05:15 +02:00
parent c561b256bf
commit 3d55dcd3c4
966 changed files with 9352 additions and 4199 deletions

View File

@@ -34,6 +34,7 @@ using Umbraco.Core.Hosting;
using Umbraco.Core.Media;
using Umbraco.Extensions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.ModelBinders;
using Umbraco.Web.BackOffice.Security;
using Umbraco.Web.Common.ActionResults;
using Umbraco.Web.Common.Attributes;
@@ -235,6 +236,33 @@ namespace Umbraco.Web.BackOffice.Controllers
return result;
}
/// <summary>
/// Get users by integer ids
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
[TypeFilter(typeof(OutgoingEditorModelEventAttribute))]
[AdminUsersAuthorize]
public IEnumerable<UserDisplay> GetByIds([FromJsonPath]int[] ids)
{
if (ids == null)
{
throw new HttpResponseException(HttpStatusCode.NotFound);
}
if (ids.Length == 0)
return Enumerable.Empty<UserDisplay>();
var users = _userService.GetUsersById(ids);
if (users == null)
{
throw new HttpResponseException(HttpStatusCode.NotFound);
}
var result = _umbracoMapper.MapEnumerable<IUser, UserDisplay>(users);
return result;
}
/// <summary>
/// Returns a paged users collection
/// </summary>