reformatting.

This commit is contained in:
Claus
2017-07-06 13:14:24 +02:00
parent fe451154d1
commit 2e29d112e5

View File

@@ -41,23 +41,23 @@ namespace Umbraco.Web.Models.Mapping
//Used for merging existing UserSave to an existing IUser instance - this will not create an IUser instance!
config.CreateMap<UserSave, IUser>()
.IgnoreDeletableEntityCommonProperties()
.ForMember(dest => dest.Id, map => map.Condition(source => GetIntId(source.Id) > 0))
.ForMember(detail => detail.SessionTimeout, opt => opt.Ignore())
.ForMember(detail => detail.EmailConfirmedDate, opt => opt.Ignore())
.ForMember(detail => detail.InvitedDate, opt => opt.Ignore())
.ForMember(detail => detail.SecurityStamp, opt => opt.Ignore())
.ForMember(detail => detail.Avatar, opt => opt.Ignore())
.ForMember(detail => detail.ProviderUserKey, opt => opt.Ignore())
.ForMember(detail => detail.RawPasswordValue, opt => opt.Ignore())
.ForMember(detail => detail.RawPasswordAnswerValue, opt => opt.Ignore())
.ForMember(detail => detail.PasswordQuestion, opt => opt.Ignore())
.ForMember(detail => detail.Comments, opt => opt.Ignore())
.ForMember(detail => detail.IsApproved, opt => opt.Ignore())
.ForMember(detail => detail.IsLockedOut, opt => opt.Ignore())
.ForMember(detail => detail.LastLoginDate, opt => opt.Ignore())
.ForMember(detail => detail.LastPasswordChangeDate, opt => opt.Ignore())
.ForMember(detail => detail.LastLockoutDate, opt => opt.Ignore())
.ForMember(detail => detail.FailedPasswordAttempts, opt => opt.Ignore())
.ForMember(dest => dest.Id, map => map.Condition(source => GetIntId(source.Id) > 0))
.ForMember(detail => detail.SessionTimeout, opt => opt.Ignore())
.ForMember(detail => detail.EmailConfirmedDate, opt => opt.Ignore())
.ForMember(detail => detail.InvitedDate, opt => opt.Ignore())
.ForMember(detail => detail.SecurityStamp, opt => opt.Ignore())
.ForMember(detail => detail.Avatar, opt => opt.Ignore())
.ForMember(detail => detail.ProviderUserKey, opt => opt.Ignore())
.ForMember(detail => detail.RawPasswordValue, opt => opt.Ignore())
.ForMember(detail => detail.RawPasswordAnswerValue, opt => opt.Ignore())
.ForMember(detail => detail.PasswordQuestion, opt => opt.Ignore())
.ForMember(detail => detail.Comments, opt => opt.Ignore())
.ForMember(detail => detail.IsApproved, opt => opt.Ignore())
.ForMember(detail => detail.IsLockedOut, opt => opt.Ignore())
.ForMember(detail => detail.LastLoginDate, opt => opt.Ignore())
.ForMember(detail => detail.LastPasswordChangeDate, opt => opt.Ignore())
.ForMember(detail => detail.LastLockoutDate, opt => opt.Ignore())
.ForMember(detail => detail.FailedPasswordAttempts, opt => opt.Ignore())
.ForMember(user => user.Language, expression => expression.MapFrom(save => save.Culture))
.AfterMap((save, user) =>
{
@@ -91,8 +91,8 @@ namespace Umbraco.Web.Models.Mapping
.ForMember(detail => detail.LastLoginDate, opt => opt.Ignore())
.ForMember(detail => detail.LastPasswordChangeDate, opt => opt.Ignore())
.ForMember(detail => detail.LastLockoutDate, opt => opt.Ignore())
.ForMember(detail => detail.FailedPasswordAttempts, opt => opt.Ignore())
//all invited users will not be approved, completing the invite will approve the user
.ForMember(detail => detail.FailedPasswordAttempts, opt => opt.Ignore())
//all invited users will not be approved, completing the invite will approve the user
.ForMember(user => user.IsApproved, expression => expression.UseValue(false))
.AfterMap((invite, user) =>
{
@@ -167,7 +167,7 @@ namespace Umbraco.Web.Models.Mapping
{
basic.Icon = "icon-user";
}
});
});
config.CreateMap<IUserGroup, UserGroupDisplay>()
.ForMember(detail => detail.StartContentId, opt => opt.Ignore())
@@ -186,19 +186,19 @@ namespace Umbraco.Web.Models.Mapping
{
MapUserGroupBasic(applicationContext.Services, group, display);
//Important! Currently we are never mapping to multiple UserGroupDisplay objects but if we start doing that
//Important! Currently we are never mapping to multiple UserGroupDisplay objects but if we start doing that
// this will cause an N+1 and we'll need to change how this works.
var users = applicationContext.Services.UserService.GetAllInGroup(group.Id);
display.Users = Mapper.Map<IEnumerable<UserBasic>>(users);
//Deal with assigned permissions:
//Deal with assigned permissions:
var allContentPermissions = applicationContext.Services.UserService.GetPermissions(group, true)
.ToDictionary(x => x.EntityId, x => x);
var contentEntities = allContentPermissions.Keys.Count == 0
? new IUmbracoEntity[0]
: applicationContext.Services.EntityService.GetAll(UmbracoObjectTypes.Document, allContentPermissions.Keys.ToArray());
var contentEntities = allContentPermissions.Keys.Count == 0
? new IUmbracoEntity[0]
: applicationContext.Services.EntityService.GetAll(UmbracoObjectTypes.Document, allContentPermissions.Keys.ToArray());
var allAssignedPermissions = new List<AssignedContentPermissions>();
foreach (var entity in contentEntities)