예제 #1
0
        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);
        }
예제 #2
0
        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);
        }