mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
[AC-1340] [Defect] Provider users unable to delete vault items for client organizations (#5242)
* [AC-1340] Calling Cipher DeleteAdmin endpoints when user has canEditAnyCollection permission * [AC-1340] Fixed CLI and Desktop builds * [AC-1340] Changed CipherService delete methods parameter 'orgAdmin' to 'asAdmin' and to nullable * [AC-1340] Changed variable names from 'orgAdmin' to 'asAdmin' * [AC-1340] Reverted change on DeleteCommand
This commit is contained in:
@@ -729,13 +729,22 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
await this.stateService.setEncryptedCiphers(ciphers);
|
||||
}
|
||||
|
||||
async deleteWithServer(id: string): Promise<any> {
|
||||
await this.apiService.deleteCipher(id);
|
||||
async deleteWithServer(id: string, asAdmin = false): Promise<any> {
|
||||
if (asAdmin) {
|
||||
await this.apiService.deleteCipherAdmin(id);
|
||||
} else {
|
||||
await this.apiService.deleteCipher(id);
|
||||
}
|
||||
|
||||
await this.delete(id);
|
||||
}
|
||||
|
||||
async deleteManyWithServer(ids: string[]): Promise<any> {
|
||||
await this.apiService.deleteManyCiphers(new CipherBulkDeleteRequest(ids));
|
||||
async deleteManyWithServer(ids: string[], asAdmin = false): Promise<any> {
|
||||
if (asAdmin) {
|
||||
await this.apiService.deleteManyCiphersAdmin(new CipherBulkDeleteRequest(ids));
|
||||
} else {
|
||||
await this.apiService.deleteManyCiphers(new CipherBulkDeleteRequest(ids));
|
||||
}
|
||||
await this.delete(ids);
|
||||
}
|
||||
|
||||
@@ -859,13 +868,23 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
await this.stateService.setEncryptedCiphers(ciphers);
|
||||
}
|
||||
|
||||
async softDeleteWithServer(id: string): Promise<any> {
|
||||
await this.apiService.putDeleteCipher(id);
|
||||
async softDeleteWithServer(id: string, asAdmin = false): Promise<any> {
|
||||
if (asAdmin) {
|
||||
await this.apiService.putDeleteCipherAdmin(id);
|
||||
} else {
|
||||
await this.apiService.putDeleteCipher(id);
|
||||
}
|
||||
|
||||
await this.softDelete(id);
|
||||
}
|
||||
|
||||
async softDeleteManyWithServer(ids: string[]): Promise<any> {
|
||||
await this.apiService.putDeleteManyCiphers(new CipherBulkDeleteRequest(ids));
|
||||
async softDeleteManyWithServer(ids: string[], asAdmin = false): Promise<any> {
|
||||
if (asAdmin) {
|
||||
await this.apiService.putDeleteManyCiphersAdmin(new CipherBulkDeleteRequest(ids));
|
||||
} else {
|
||||
await this.apiService.putDeleteManyCiphers(new CipherBulkDeleteRequest(ids));
|
||||
}
|
||||
|
||||
await this.softDelete(ids);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user