Add user picker property editor (#7613)
This commit is contained in:
committed by
GitHub
parent
2ca7cc9ccc
commit
41d1e33fc4
@@ -178,6 +178,33 @@ namespace Umbraco.Web.Editors
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get users by integer ids
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
[OutgoingEditorModelEvent]
|
||||
[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 = Services.UserService.GetUsersById(ids);
|
||||
if (users == null)
|
||||
{
|
||||
throw new HttpResponseException(HttpStatusCode.NotFound);
|
||||
}
|
||||
|
||||
var result = Mapper.MapEnumerable<IUser, UserDisplay>(users);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a paged users collection
|
||||
/// </summary>
|
||||
|
||||
@@ -7,7 +7,8 @@ namespace Umbraco.Web.PropertyEditors
|
||||
{
|
||||
public override IDictionary<string, object> DefaultConfiguration => new Dictionary<string, object>
|
||||
{
|
||||
{"entityType", "User"}
|
||||
{ "entityType", "User" },
|
||||
{ "multiPicker", "0" }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ namespace Umbraco.Web.PropertyEditors
|
||||
{
|
||||
[DataEditor(
|
||||
Constants.PropertyEditors.Aliases.UserPicker,
|
||||
"User picker",
|
||||
"entitypicker",
|
||||
"User Picker",
|
||||
"userpicker",
|
||||
ValueType = ValueTypes.Integer,
|
||||
Group = Constants.PropertyEditors.Groups.People,
|
||||
Icon = Constants.Icons.User)]
|
||||
|
||||
Reference in New Issue
Block a user