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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user