Skip to content

Commit

Permalink
Add organization.flexibleCollections to models (#7442)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliykat committed Jan 11, 2024
1 parent a572e41 commit 1f57244
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class OrganizationData {
accessSecretsManager: boolean;
limitCollectionCreationDeletion: boolean;
allowAdminAccessToAllCollectionItems: boolean;
flexibleCollections: boolean;

constructor(
response: ProfileOrganizationResponse,
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions libs/common/src/admin-console/models/domain/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class OrganizationResponse extends BaseResponse {
maxAutoscaleSmServiceAccounts?: number;
limitCollectionCreationDeletion: boolean;
allowAdminAccessToAllCollectionItems: boolean;
flexibleCollections: boolean;

constructor(response: any) {
super(response);
Expand Down Expand Up @@ -75,5 +76,6 @@ export class OrganizationResponse extends BaseResponse {
this.allowAdminAccessToAllCollectionItems = this.getResponseProperty(
"AllowAdminAccessToAllCollectionItems",
);
this.flexibleCollections = this.getResponseProperty("FlexibleCollections");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class ProfileOrganizationResponse extends BaseResponse {
accessSecretsManager: boolean;
limitCollectionCreationDeletion: boolean;
allowAdminAccessToAllCollectionItems: boolean;
flexibleCollections: boolean;

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

0 comments on commit 1f57244

Please sign in to comment.