Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }