private async Task <UserInvitation> Map(IMapper mapper, CoreSettings settings, IUserInvitation innerInvitation) { UserInvitation result = mapper.Map <UserInvitation>(innerInvitation); result.EmailAddress = (await innerInvitation.GetEmailAddress(settings)).Address; return(result); }
private async Task <bool> UserCanAccessInvitation(CoreSettings settings, IUserInvitation userInvitation) { bool result = UserCanAccessAccount(userInvitation.AccountId); if (!result) { string email = User.Claims.First(c => c.Type == ClaimTypes.Email).Value; IEmailAddress emailAddress = await userInvitation.GetEmailAddress(settings); result = string.Equals(email, emailAddress.Address, StringComparison.OrdinalIgnoreCase); } return(result); }