Exemple #1
0
        public async Task <IActionResult> Delete(int id)
        {
            if (!await _authorizationService.CanUserModifyProtocolAsync(UserId, id))
            {
                Unauthorized();
            }

            await _protocolsService.DeleteProtocol(id);

            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public IActionResult Delete(int id)
        {
            if (!_authorizationService.CanUserModifyProtocol(UserId, id))
            {
                Unauthorized();
            }

            _protocolsService.DeleteProtocol(id);

            return(RedirectToAction("Index"));
        }