1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-07-01 11:25:46 +02:00

Add organization.flexibleCollections to models (#7442)

This commit is contained in:
Thomas Rittson 2024-01-11 13:52:18 +10:00 committed by GitHub
parent a572e4119e
commit 1f57244d1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 0 deletions

View File

@ -51,6 +51,7 @@ export class OrganizationData {
accessSecretsManager: boolean;
limitCollectionCreationDeletion: boolean;
allowAdminAccessToAllCollectionItems: boolean;
flexibleCollections: boolean;
constructor(
response: ProfileOrganizationResponse,
@ -104,6 +105,7 @@ export class OrganizationData {
this.accessSecretsManager = response.accessSecretsManager;
this.limitCollectionCreationDeletion = response.limitCollectionCreationDeletion;
this.allowAdminAccessToAllCollectionItems = response.allowAdminAccessToAllCollectionItems;
this.flexibleCollections = response.flexibleCollections;
this.isMember = options.isMember;
this.isProviderUser = options.isProviderUser;

View File

@ -72,6 +72,11 @@ export class Organization {
* Refers to the ability for an owner/admin to access all collection items, regardless of assigned collections
*/
allowAdminAccessToAllCollectionItems: boolean;
/**
* Returns true if this organization has enabled Flexible Collections (MVP) and their data has been migrated.
* Generally, you should use this as the feature flag to gate Flexible Collections features.
*/
flexibleCollections: boolean;
constructor(obj?: OrganizationData) {
if (obj == null) {
@ -125,6 +130,7 @@ export class Organization {
this.accessSecretsManager = obj.accessSecretsManager;
this.limitCollectionCreationDeletion = obj.limitCollectionCreationDeletion;
this.allowAdminAccessToAllCollectionItems = obj.allowAdminAccessToAllCollectionItems;
this.flexibleCollections = obj.flexibleCollections;
}
get canAccess() {

View File

@ -34,6 +34,7 @@ export class OrganizationResponse extends BaseResponse {
maxAutoscaleSmServiceAccounts?: number;
limitCollectionCreationDeletion: boolean;
allowAdminAccessToAllCollectionItems: boolean;
flexibleCollections: boolean;
constructor(response: any) {
super(response);
@ -75,5 +76,6 @@ export class OrganizationResponse extends BaseResponse {
this.allowAdminAccessToAllCollectionItems = this.getResponseProperty(
"AllowAdminAccessToAllCollectionItems",
);
this.flexibleCollections = this.getResponseProperty("FlexibleCollections");
}
}

View File

@ -50,6 +50,7 @@ export class ProfileOrganizationResponse extends BaseResponse {
accessSecretsManager: boolean;
limitCollectionCreationDeletion: boolean;
allowAdminAccessToAllCollectionItems: boolean;
flexibleCollections: boolean;
constructor(response: any) {
super(response);
@ -113,5 +114,6 @@ export class ProfileOrganizationResponse extends BaseResponse {
this.allowAdminAccessToAllCollectionItems = this.getResponseProperty(
"AllowAdminAccessToAllCollectionItems",
);
this.flexibleCollections = this.getResponseProperty("FlexibleCollections");
}
}