1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

[AC-2320] Update canEditAnyCollection logic for Flexible Collections v1 (#8394)

* also update calling locations to use canEditAllCiphers where applicable
This commit is contained in:
Thomas Rittson
2024-04-04 13:48:41 +10:00
committed by GitHub
parent 678ba04781
commit 32981ce30d
13 changed files with 140 additions and 44 deletions

View File

@@ -53,11 +53,11 @@ export class CollectionView implements View, ITreeNodeObject {
);
}
return org?.canEditAnyCollection || (org?.canEditAssignedCollections && this.assigned);
return org?.canEditAnyCollection(false) || (org?.canEditAssignedCollections && this.assigned);
}
// For editing collection details, not the items within it.
canEdit(org: Organization): boolean {
canEdit(org: Organization, flexibleCollectionsV1Enabled: boolean): boolean {
if (org != null && org.id !== this.organizationId) {
throw new Error(
"Id of the organization provided does not match the org id of the collection.",
@@ -65,8 +65,8 @@ export class CollectionView implements View, ITreeNodeObject {
}
return org?.flexibleCollections
? org?.canEditAnyCollection || this.manage
: org?.canEditAnyCollection || org?.canEditAssignedCollections;
? org?.canEditAnyCollection(flexibleCollectionsV1Enabled) || this.manage
: org?.canEditAnyCollection(flexibleCollectionsV1Enabled) || org?.canEditAssignedCollections;
}
// For deleting a collection, not the items within it.