1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 22:03:36 +00:00

Split Organization.LimitCollectionCreationDeletion into two separate business rules (#11223)

* Declare feature flag

* Introduce new model properties

* Reference feature toggle in template

* Fix bugs caught during manual testing
This commit is contained in:
Addison Beck
2024-10-17 06:34:34 -04:00
committed by GitHub
parent 80e6b1afd1
commit 073ee4739b
12 changed files with 120 additions and 25 deletions

View File

@@ -68,7 +68,11 @@ export class Organization {
/**
* Refers to the ability for an organization to limit collection creation and deletion to owners and admins only
*/
limitCollectionCreation: boolean;
limitCollectionDeletion: boolean;
// Deprecated: https://bitwarden.atlassian.net/browse/PM-10863
limitCollectionCreationDeletion: boolean;
/**
* Refers to the ability for an owner/admin to access all collection items, regardless of assigned collections
*/
@@ -125,6 +129,9 @@ export class Organization {
this.familySponsorshipValidUntil = obj.familySponsorshipValidUntil;
this.familySponsorshipToDelete = obj.familySponsorshipToDelete;
this.accessSecretsManager = obj.accessSecretsManager;
this.limitCollectionCreation = obj.limitCollectionCreation;
this.limitCollectionDeletion = obj.limitCollectionDeletion;
// Deprecated: https://bitwarden.atlassian.net/browse/PM-10863
this.limitCollectionCreationDeletion = obj.limitCollectionCreationDeletion;
this.allowAdminAccessToAllCollectionItems = obj.allowAdminAccessToAllCollectionItems;
}
@@ -163,9 +170,7 @@ export class Organization {
}
get canCreateNewCollections() {
return (
!this.limitCollectionCreationDeletion || this.isAdmin || this.permissions.createNewCollections
);
return !this.limitCollectionCreation || this.isAdmin || this.permissions.createNewCollections;
}
get canEditAnyCollection() {