1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +00:00

PM-238 Master Reprompt Enabled Appears on Item in Organization (#5858)

* add-edit components and cipher service updated for organization item saveCiphers
* update cipher service spec file
This commit is contained in:
Jason Ng
2023-08-04 11:45:32 -04:00
committed by GitHub
parent 0bb76e2d06
commit 8613b83d98
5 changed files with 186 additions and 55 deletions

View File

@@ -20,8 +20,6 @@ import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folde
import { PasswordRepromptService } from "@bitwarden/common/vault/abstractions/password-reprompt.service";
import { CipherData } from "@bitwarden/common/vault/models/data/cipher.data";
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
import { CipherCreateRequest } from "@bitwarden/common/vault/models/request/cipher-create.request";
import { CipherRequest } from "@bitwarden/common/vault/models/request/cipher.request";
import { AddEditComponent as BaseAddEditComponent } from "../individual-vault/add-edit.component";
@@ -115,19 +113,6 @@ export class AddEditComponent extends BaseAddEditComponent {
return this.cipherService.encrypt(this.cipher, null, this.originalCipher);
}
protected async saveCipher(cipher: Cipher) {
if (!this.organization.canEditAnyCollection || cipher.organizationId == null) {
return super.saveCipher(cipher);
}
if (this.editMode && !this.cloneMode) {
const request = new CipherRequest(cipher);
return this.apiService.putCipherAdmin(this.cipherId, request);
} else {
const request = new CipherCreateRequest(cipher);
return this.apiService.postCipherAdmin(request);
}
}
protected async deleteCipher() {
if (!this.organization.canEditAnyCollection) {
return super.deleteCipher();