Merge remote-tracking branch 'netcore/dev' into netcore/netcore
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user