1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 13:23:34 +00:00

[AC-2285] Edit Unassigned Ciphers in AC Bug (#8410)

* check if cipher is unassigned and call the proper service between cipherService get and apiService get. also check for custom user permissions
This commit is contained in:
Jason Ng
2024-03-26 15:22:35 -04:00
committed by GitHub
parent 1e75f24671
commit 7f55833974
3 changed files with 12 additions and 7 deletions

View File

@@ -650,11 +650,11 @@ export class AddEditComponent implements OnInit, OnDestroy {
protected saveCipher(cipher: Cipher) {
const isNotClone = this.editMode && !this.cloneMode;
let orgAdmin = this.organization?.isAdmin;
let orgAdmin = this.organization?.canEditAllCiphers(this.flexibleCollectionsV1Enabled);
if (this.flexibleCollectionsV1Enabled) {
// Flexible Collections V1 restricts admins, check the organization setting via canEditAllCiphers
orgAdmin = this.organization?.canEditAllCiphers(true);
// if a cipher is unassigned we want to check if they are an admin or have permission to edit any collection
if (!cipher.collectionIds) {
orgAdmin = this.organization?.canEditAnyCollection;
}
return this.cipher.id == null

View File

@@ -1387,7 +1387,6 @@ export class CipherService implements CipherServiceAbstraction {
cipher.attachments = attachments;
}),
]);
return cipher;
}