1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-09 05:32:24 -05:00

[PM-19383] admins unable to delete attachments (#5774)

* add admin endpoint, fix typecasting error

* fix typecast issue

* wip

* cleanup

* remove ternary statement
This commit is contained in:
Brandon Treston 2025-05-06 15:36:28 -04:00 committed by GitHub
parent 28467fc8f6
commit ee2399f500
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -891,7 +891,14 @@ public class CipherService : ICipherService
// Update the revision date when an attachment is deleted // Update the revision date when an attachment is deleted
cipher.RevisionDate = DateTime.UtcNow; cipher.RevisionDate = DateTime.UtcNow;
await _cipherRepository.ReplaceAsync(orgAdmin ? cipher : (CipherDetails)cipher); if (orgAdmin)
{
await _cipherRepository.ReplaceAsync(cipher);
}
else
{
await _cipherRepository.ReplaceAsync((CipherDetails)cipher);
}
// push // push
await _pushService.PushSyncCipherUpdateAsync(cipher, null); await _pushService.PushSyncCipherUpdateAsync(cipher, null);