public async Task <IActionResult> Delete(int id) { if (!await _authorizationService.CanUserModifyProtocolAsync(UserId, id)) { Unauthorized(); } await _protocolsService.DeleteProtocol(id); return(RedirectToAction("Index")); }
public IActionResult Delete(int id) { if (!_authorizationService.CanUserModifyProtocol(UserId, id)) { Unauthorized(); } _protocolsService.DeleteProtocol(id); return(RedirectToAction("Index")); }