예제 #1
0
        public async Task <IActionResult> AddUserClaims([FromBody] AddUserClaimsRequest addClaimsRequest)
        {
            ApplicationUser user = await _claimService.FindByEmailAsync(addClaimsRequest.Email);

            if (user != null)
            {
                foreach (ApplicationUserClaim claim in addClaimsRequest.Claims)
                {
                    await _claimService.AddClaimAsync(user, new Claim(claim.ClaimType, claim.ClaimValue));
                }

                return(Ok("Claims SuccessFully Added For User " + addClaimsRequest.Email));
            }
            return(Ok("Failed To Add Claims For User " + addClaimsRequest.Email));
        }