public async Task <InvokeResult> DeleteSimulatorAsync(string id, EntityHeader org, EntityHeader user) { var simulator = await _simulatorRepo.GetSimulatorAsync(id); await AuthorizeAsync(simulator, AuthorizeActions.Delete, user, org); await ConfirmNoDepenenciesAsync(simulator); await _simulatorRepo.DeleteSimulatorAsync(id); if (!String.IsNullOrEmpty(simulator.PasswordSecureId)) { await _secureStorage.RemoveSecretAsync(org, simulator.PasswordSecureId); } if (!String.IsNullOrEmpty(simulator.AccessKeySecureId)) { await _secureStorage.RemoveSecretAsync(org, simulator.AccessKeySecureId); } if (!String.IsNullOrEmpty(simulator.AuthHeaderSecureId)) { await _secureStorage.RemoveSecretAsync(org, simulator.AuthHeaderSecureId); } return(InvokeResult.Success); }
public async Task <InvokeResult> DeleteSimulatorAsync(string id, EntityHeader org, EntityHeader user) { var simulator = await _simulatorRepo.GetSimulatorAsync(id); await AuthorizeAsync(simulator, AuthorizeActions.Create, user, org); await ConfirmNoDepenenciesAsync(simulator); await _simulatorRepo.DeleteSimulatorAsync(id); return(InvokeResult.Success); }