Example #1
0
        public async Task DeleteAsync(Cipher cipher, Guid deletingUserId, bool orgAdmin = false)
        {
            if (!orgAdmin && !(await UserCanEditAsync(cipher, deletingUserId)))
            {
                throw new BadRequestException("You do not have permissions to delete this.");
            }

            await _cipherRepository.DeleteAsync(cipher);

            await _attachmentStorageService.DeleteAttachmentsForCipherAsync(cipher.Id);

            // push
            await _pushService.PushSyncCipherDeleteAsync(cipher);
        }
Example #2
0
        public async Task DeleteAsync(Cipher cipher)
        {
            await _cipherRepository.DeleteAsync(cipher);

            // push
            await _pushService.PushSyncCipherDeleteAsync(cipher);
        }
Example #3
0
        public async Task DeleteDataAsync(string id)
        {
            await _cipherRepository.DeleteAsync(id);

            CachedCiphers = null;
            _appSettingsService.ClearCiphersCache = true;
        }
Example #4
0
        public async Task DeleteAsync(CipherDetails cipher, Guid deletingUserId)
        {
            if (!(await UserCanEditAsync(cipher, deletingUserId)))
            {
                throw new BadRequestException("Not an admin.");
            }

            await _cipherRepository.DeleteAsync(cipher);

            // push
            //await _pushService.PushSyncCipherDeleteAsync(cipher);
        }
Example #5
0
        public async Task DeleteDataAsync(string id, bool sendMessage)
        {
            if (sendMessage)
            {
                var cipherData = await _cipherRepository.GetByIdAsync(id);

                if (cipherData != null && Application.Current != null)
                {
                    MessagingCenter.Send(Application.Current, "DeletedCipher", new Cipher(cipherData));
                }
            }
            await _cipherRepository.DeleteAsync(id);

            CachedCiphers = null;
            _appSettingsService.ClearCiphersCache = true;
        }
Example #6
0
        public async Task DeleteDataAsync(string id)
        {
            await _cipherRepository.DeleteAsync(id);

            CachedCiphers = null;
        }