adds invite user endpoint with a controller test!

This commit is contained in:
Shannon
2017-05-24 19:01:01 +10:00
parent f792be9495
commit 38837049f0
12 changed files with 186 additions and 37 deletions

View File

@@ -16,6 +16,16 @@ namespace Umbraco.Web.Models.Mapping
{
public override void ConfigureMappings(IConfiguration config, ApplicationContext applicationContext)
{
config.CreateMap<UserInvite, IUser>()
.ConstructUsing(invite => new User(invite.Name, invite.Email, invite.Email, Guid.NewGuid().ToString("N")))
.AfterMap((invite, user) =>
{
foreach (var group in invite.UserGroups)
{
user.AddGroup(group);
}
});
config.CreateMap<IUserGroup, UserGroupDisplay>()
.ForMember(detail => detail.Notifications, opt => opt.Ignore())
.ForMember(detail => detail.Sections, opt => opt.MapFrom(x => x.AllowedSections))