Пример #1
0
        public async Task <IActionResult> ClientClaimDelete(ClientClaimsDto clientClaim)
        {
            await _clientService.DeleteClientClaimAsync(clientClaim);


            return(Success(new { Id = clientClaim.ClientId }));
        }
        public async Task <IActionResult> UpdateClaims(int id, ClientClaimsDto input)
        {
            _repository.UpdateClaims(id, input.Claims.ToArray());
            await _repository.SaveChangesAsync();

            return(await GetClaims(id));
        }
        public async Task <IActionResult> ClientClaimDelete(ClientClaimsDto clientClaim)
        {
            await _clientService.DeleteClientClaimAsync(clientClaim);

            SuccessNotification(_localizer["SuccessDeleteClientClaim"], _localizer["SuccessTitle"]);

            return(RedirectToAction(nameof(ClientClaims), new { Id = clientClaim.ClientId }));
        }
Пример #4
0
        public virtual async Task <int> DeleteClientClaimAsync(ClientClaimsDto clientClaim)
        {
            var clientClaimEntity = clientClaim.ToEntity();

            var deleted = await ClientRepository.DeleteClientClaimAsync(clientClaimEntity);

            await AuditEventLogger.LogEventAsync(new ClientClaimDeletedEvent(clientClaim));

            return(deleted);
        }
Пример #5
0
        public virtual async Task <int> AddClientClaimAsync(ClientClaimsDto clientClaim)
        {
            var clientClaimEntity = clientClaim.ToEntity();

            var saved = await ClientRepository.AddClientClaimAsync(clientClaim.ClientId, clientClaimEntity);

            await AuditEventLogger.LogEventAsync(new ClientClaimAddedEvent(clientClaim));

            return(saved);
        }
Пример #6
0
        public async Task <IActionResult> DeleteClaim(int claimId)
        {
            var clientClaimsDto = new ClientClaimsDto {
                ClientClaimId = claimId
            };

            await _clientService.GetClientClaimAsync(claimId);

            await _clientService.DeleteClientClaimAsync(clientClaimsDto);

            return(Ok());
        }
Пример #7
0
        public async Task <IActionResult> ClientClaims(ClientClaimsDto clientClaim)
        {
            if (!ModelState.IsValid)
            {
                return(Success(clientClaim));
            }

            await _clientService.AddClientClaimAsync(clientClaim);


            return(Success(new { Id = clientClaim.ClientId }));
        }
        public async Task <IActionResult> ClientClaims(ClientClaimsDto clientClaim)
        {
            if (!ModelState.IsValid)
            {
                return(View(clientClaim));
            }

            await _clientService.AddClientClaimAsync(clientClaim);

            SuccessNotification(string.Format(_localizer["SuccessAddClientClaim"], clientClaim.Value, clientClaim.ClientName), _localizer["SuccessTitle"]);

            return(RedirectToAction(nameof(ClientClaims), new { Id = clientClaim.ClientId }));
        }
Пример #9
0
        public async Task <IActionResult> ClientClaimDelete(ClientClaimsDto clientClaim)
        {
            if (await IsUserManagerOrAdmin(clientClaim.ClientId))
            {
                await _clientService.DeleteClientClaimAsync(clientClaim);

                SuccessNotification(_localizer["SuccessDeleteClientClaim"], _localizer["SuccessTitle"]);
            }
            else
            {
                UnauthorizedNotification();
            }

            return(RedirectToAction(nameof(ClientClaims), new { Id = clientClaim.ClientId }));
        }
Пример #10
0
 public static ClientClaim ToEntity(this ClientClaimsDto clientClaim, IMapper mapper)
 {
     return(mapper.Map <ClientClaim>(clientClaim));
 }
 public ClientClaimDeletedEvent(ClientClaimsDto clientClaim)
 {
     ClientClaim = clientClaim;
 }
        public async Task <int> DeleteClientClaimAsync(ClientClaimsDto clientClaim)
        {
            var clientClaimEntity = clientClaim.ToEntity();

            return(await _clientRepository.DeleteClientClaimAsync(clientClaimEntity));
        }
Пример #13
0
        public virtual async Task <int> AddClientClaimAsync(ClientClaimsDto clientClaim)
        {
            var clientClaimEntity = clientClaim.ToEntity();

            return(await ClientRepository.AddClientClaimAsync(clientClaim.ClientId, clientClaimEntity));
        }
 public ClientClaimsRequestedEvent(ClientClaimsDto clientClaims)
 {
     ClientClaims = clientClaims;
 }
Пример #15
0
 public ClientClaimAddedEvent(ClientClaimsDto clientClaim)
 {
     ClientClaim = clientClaim;
 }