From 256d946026815a0e8638b5bdb77f36ad7dad3e55 Mon Sep 17 00:00:00 2001 From: Jimmy Vo Date: Mon, 27 Jan 2025 11:17:35 -0500 Subject: [PATCH 1/2] [pm-17363] Add LimitItemDeletion property to models --- .../admin-console/models/data/organization.data.spec.ts | 1 + .../src/admin-console/models/data/organization.data.ts | 2 ++ .../common/src/admin-console/models/domain/organization.ts | 7 +++++++ .../organization-collection-management-update.request.ts | 1 + .../admin-console/models/response/organization.response.ts | 2 ++ .../models/response/profile-organization.response.ts | 2 ++ .../common/src/auth/services/key-connector.service.spec.ts | 1 + 7 files changed, 16 insertions(+) diff --git a/libs/common/src/admin-console/models/data/organization.data.spec.ts b/libs/common/src/admin-console/models/data/organization.data.spec.ts index 8a49109f343..5322b988545 100644 --- a/libs/common/src/admin-console/models/data/organization.data.spec.ts +++ b/libs/common/src/admin-console/models/data/organization.data.spec.ts @@ -53,6 +53,7 @@ describe("ORGANIZATIONS state", () => { accessSecretsManager: false, limitCollectionCreation: false, limitCollectionDeletion: false, + LimitItemDeletion: false, allowAdminAccessToAllCollectionItems: false, familySponsorshipLastSyncDate: new Date(), userIsManagedByOrganization: false, diff --git a/libs/common/src/admin-console/models/data/organization.data.ts b/libs/common/src/admin-console/models/data/organization.data.ts index 8ec84b5fd09..f4290e2a9f8 100644 --- a/libs/common/src/admin-console/models/data/organization.data.ts +++ b/libs/common/src/admin-console/models/data/organization.data.ts @@ -56,6 +56,7 @@ export class OrganizationData { accessSecretsManager: boolean; limitCollectionCreation: boolean; limitCollectionDeletion: boolean; + LimitItemDeletion: boolean; allowAdminAccessToAllCollectionItems: boolean; userIsManagedByOrganization: boolean; useRiskInsights: boolean; @@ -117,6 +118,7 @@ export class OrganizationData { this.accessSecretsManager = response.accessSecretsManager; this.limitCollectionCreation = response.limitCollectionCreation; this.limitCollectionDeletion = response.limitCollectionDeletion; + this.LimitItemDeletion = response.LimitItemDeletion; this.allowAdminAccessToAllCollectionItems = response.allowAdminAccessToAllCollectionItems; this.userIsManagedByOrganization = response.userIsManagedByOrganization; this.useRiskInsights = response.useRiskInsights; diff --git a/libs/common/src/admin-console/models/domain/organization.ts b/libs/common/src/admin-console/models/domain/organization.ts index 9dcc9f0752c..d76ace0faf2 100644 --- a/libs/common/src/admin-console/models/domain/organization.ts +++ b/libs/common/src/admin-console/models/domain/organization.ts @@ -76,6 +76,12 @@ export class Organization { /** * Refers to the ability for an owner/admin to access all collection items, regardless of assigned collections */ + LimitItemDeletion: boolean; + /** + * Refers to the ability to limit delete permission of collection items. + * If set to true, members can only delete items when they have a Can Manage permission over the collection. + * If set to false, members can delete items when they have a Can Manage OR Can Edit permission over the collection. + */ allowAdminAccessToAllCollectionItems: boolean; /** * Indicates if this organization manages the user. @@ -138,6 +144,7 @@ export class Organization { this.accessSecretsManager = obj.accessSecretsManager; this.limitCollectionCreation = obj.limitCollectionCreation; this.limitCollectionDeletion = obj.limitCollectionDeletion; + this.LimitItemDeletion = obj.LimitItemDeletion; this.allowAdminAccessToAllCollectionItems = obj.allowAdminAccessToAllCollectionItems; this.userIsManagedByOrganization = obj.userIsManagedByOrganization; this.useRiskInsights = obj.useRiskInsights; diff --git a/libs/common/src/admin-console/models/request/organization-collection-management-update.request.ts b/libs/common/src/admin-console/models/request/organization-collection-management-update.request.ts index 23c39376d71..626e5221ec1 100644 --- a/libs/common/src/admin-console/models/request/organization-collection-management-update.request.ts +++ b/libs/common/src/admin-console/models/request/organization-collection-management-update.request.ts @@ -3,5 +3,6 @@ export class OrganizationCollectionManagementUpdateRequest { limitCollectionCreation: boolean; limitCollectionDeletion: boolean; + LimitItemDeletion: boolean; allowAdminAccessToAllCollectionItems: boolean; } diff --git a/libs/common/src/admin-console/models/response/organization.response.ts b/libs/common/src/admin-console/models/response/organization.response.ts index fd54ff128b6..0ec12589c4a 100644 --- a/libs/common/src/admin-console/models/response/organization.response.ts +++ b/libs/common/src/admin-console/models/response/organization.response.ts @@ -36,6 +36,7 @@ export class OrganizationResponse extends BaseResponse { maxAutoscaleSmServiceAccounts?: number; limitCollectionCreation: boolean; limitCollectionDeletion: boolean; + LimitItemDeletion: boolean; allowAdminAccessToAllCollectionItems: boolean; useRiskInsights: boolean; @@ -75,6 +76,7 @@ export class OrganizationResponse extends BaseResponse { this.maxAutoscaleSmServiceAccounts = this.getResponseProperty("MaxAutoscaleSmServiceAccounts"); this.limitCollectionCreation = this.getResponseProperty("LimitCollectionCreation"); this.limitCollectionDeletion = this.getResponseProperty("LimitCollectionDeletion"); + this.LimitItemDeletion = this.getResponseProperty("LimitItemDeletion"); this.allowAdminAccessToAllCollectionItems = this.getResponseProperty( "AllowAdminAccessToAllCollectionItems", ); diff --git a/libs/common/src/admin-console/models/response/profile-organization.response.ts b/libs/common/src/admin-console/models/response/profile-organization.response.ts index 9c4b8885ab8..a0213c9f81a 100644 --- a/libs/common/src/admin-console/models/response/profile-organization.response.ts +++ b/libs/common/src/admin-console/models/response/profile-organization.response.ts @@ -51,6 +51,7 @@ export class ProfileOrganizationResponse extends BaseResponse { accessSecretsManager: boolean; limitCollectionCreation: boolean; limitCollectionDeletion: boolean; + LimitItemDeletion: boolean; allowAdminAccessToAllCollectionItems: boolean; userIsManagedByOrganization: boolean; useRiskInsights: boolean; @@ -114,6 +115,7 @@ export class ProfileOrganizationResponse extends BaseResponse { this.accessSecretsManager = this.getResponseProperty("AccessSecretsManager"); this.limitCollectionCreation = this.getResponseProperty("LimitCollectionCreation"); this.limitCollectionDeletion = this.getResponseProperty("LimitCollectionDeletion"); + this.LimitItemDeletion = this.getResponseProperty("LimitItemDeletion"); this.allowAdminAccessToAllCollectionItems = this.getResponseProperty( "AllowAdminAccessToAllCollectionItems", ); diff --git a/libs/common/src/auth/services/key-connector.service.spec.ts b/libs/common/src/auth/services/key-connector.service.spec.ts index 843ac383013..a8548727fff 100644 --- a/libs/common/src/auth/services/key-connector.service.spec.ts +++ b/libs/common/src/auth/services/key-connector.service.spec.ts @@ -368,6 +368,7 @@ describe("KeyConnectorService", () => { accessSecretsManager: false, limitCollectionCreation: true, limitCollectionDeletion: true, + LimitItemDeletion: true, allowAdminAccessToAllCollectionItems: true, flexibleCollections: false, object: "profileOrganization", From 4592797982d7eee7d3a92f31d52f0287b2ec6c99 Mon Sep 17 00:00:00 2001 From: Jimmy Vo Date: Wed, 29 Jan 2025 10:06:34 -0500 Subject: [PATCH 2/2] [pm-17363] Fix naming convention. --- .../src/admin-console/models/data/organization.data.spec.ts | 2 +- .../common/src/admin-console/models/data/organization.data.ts | 4 ++-- libs/common/src/admin-console/models/domain/organization.ts | 4 ++-- .../organization-collection-management-update.request.ts | 2 +- .../admin-console/models/response/organization.response.ts | 4 ++-- .../models/response/profile-organization.response.ts | 4 ++-- libs/common/src/auth/services/key-connector.service.spec.ts | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libs/common/src/admin-console/models/data/organization.data.spec.ts b/libs/common/src/admin-console/models/data/organization.data.spec.ts index 5322b988545..5f487e1f898 100644 --- a/libs/common/src/admin-console/models/data/organization.data.spec.ts +++ b/libs/common/src/admin-console/models/data/organization.data.spec.ts @@ -53,7 +53,7 @@ describe("ORGANIZATIONS state", () => { accessSecretsManager: false, limitCollectionCreation: false, limitCollectionDeletion: false, - LimitItemDeletion: false, + limitItemDeletion: false, allowAdminAccessToAllCollectionItems: false, familySponsorshipLastSyncDate: new Date(), userIsManagedByOrganization: false, diff --git a/libs/common/src/admin-console/models/data/organization.data.ts b/libs/common/src/admin-console/models/data/organization.data.ts index f4290e2a9f8..b81d06e6367 100644 --- a/libs/common/src/admin-console/models/data/organization.data.ts +++ b/libs/common/src/admin-console/models/data/organization.data.ts @@ -56,7 +56,7 @@ export class OrganizationData { accessSecretsManager: boolean; limitCollectionCreation: boolean; limitCollectionDeletion: boolean; - LimitItemDeletion: boolean; + limitItemDeletion: boolean; allowAdminAccessToAllCollectionItems: boolean; userIsManagedByOrganization: boolean; useRiskInsights: boolean; @@ -118,7 +118,7 @@ export class OrganizationData { this.accessSecretsManager = response.accessSecretsManager; this.limitCollectionCreation = response.limitCollectionCreation; this.limitCollectionDeletion = response.limitCollectionDeletion; - this.LimitItemDeletion = response.LimitItemDeletion; + this.limitItemDeletion = response.limitItemDeletion; this.allowAdminAccessToAllCollectionItems = response.allowAdminAccessToAllCollectionItems; this.userIsManagedByOrganization = response.userIsManagedByOrganization; this.useRiskInsights = response.useRiskInsights; diff --git a/libs/common/src/admin-console/models/domain/organization.ts b/libs/common/src/admin-console/models/domain/organization.ts index d76ace0faf2..6f7ff561f04 100644 --- a/libs/common/src/admin-console/models/domain/organization.ts +++ b/libs/common/src/admin-console/models/domain/organization.ts @@ -76,7 +76,7 @@ export class Organization { /** * Refers to the ability for an owner/admin to access all collection items, regardless of assigned collections */ - LimitItemDeletion: boolean; + limitItemDeletion: boolean; /** * Refers to the ability to limit delete permission of collection items. * If set to true, members can only delete items when they have a Can Manage permission over the collection. @@ -144,7 +144,7 @@ export class Organization { this.accessSecretsManager = obj.accessSecretsManager; this.limitCollectionCreation = obj.limitCollectionCreation; this.limitCollectionDeletion = obj.limitCollectionDeletion; - this.LimitItemDeletion = obj.LimitItemDeletion; + this.limitItemDeletion = obj.limitItemDeletion; this.allowAdminAccessToAllCollectionItems = obj.allowAdminAccessToAllCollectionItems; this.userIsManagedByOrganization = obj.userIsManagedByOrganization; this.useRiskInsights = obj.useRiskInsights; diff --git a/libs/common/src/admin-console/models/request/organization-collection-management-update.request.ts b/libs/common/src/admin-console/models/request/organization-collection-management-update.request.ts index 626e5221ec1..2545a725598 100644 --- a/libs/common/src/admin-console/models/request/organization-collection-management-update.request.ts +++ b/libs/common/src/admin-console/models/request/organization-collection-management-update.request.ts @@ -3,6 +3,6 @@ export class OrganizationCollectionManagementUpdateRequest { limitCollectionCreation: boolean; limitCollectionDeletion: boolean; - LimitItemDeletion: boolean; + limitItemDeletion: boolean; allowAdminAccessToAllCollectionItems: boolean; } diff --git a/libs/common/src/admin-console/models/response/organization.response.ts b/libs/common/src/admin-console/models/response/organization.response.ts index 0ec12589c4a..235ea2f8d96 100644 --- a/libs/common/src/admin-console/models/response/organization.response.ts +++ b/libs/common/src/admin-console/models/response/organization.response.ts @@ -36,7 +36,7 @@ export class OrganizationResponse extends BaseResponse { maxAutoscaleSmServiceAccounts?: number; limitCollectionCreation: boolean; limitCollectionDeletion: boolean; - LimitItemDeletion: boolean; + limitItemDeletion: boolean; allowAdminAccessToAllCollectionItems: boolean; useRiskInsights: boolean; @@ -76,7 +76,7 @@ export class OrganizationResponse extends BaseResponse { this.maxAutoscaleSmServiceAccounts = this.getResponseProperty("MaxAutoscaleSmServiceAccounts"); this.limitCollectionCreation = this.getResponseProperty("LimitCollectionCreation"); this.limitCollectionDeletion = this.getResponseProperty("LimitCollectionDeletion"); - this.LimitItemDeletion = this.getResponseProperty("LimitItemDeletion"); + this.limitItemDeletion = this.getResponseProperty("LimitItemDeletion"); this.allowAdminAccessToAllCollectionItems = this.getResponseProperty( "AllowAdminAccessToAllCollectionItems", ); diff --git a/libs/common/src/admin-console/models/response/profile-organization.response.ts b/libs/common/src/admin-console/models/response/profile-organization.response.ts index a0213c9f81a..5e37cfc4c5c 100644 --- a/libs/common/src/admin-console/models/response/profile-organization.response.ts +++ b/libs/common/src/admin-console/models/response/profile-organization.response.ts @@ -51,7 +51,7 @@ export class ProfileOrganizationResponse extends BaseResponse { accessSecretsManager: boolean; limitCollectionCreation: boolean; limitCollectionDeletion: boolean; - LimitItemDeletion: boolean; + limitItemDeletion: boolean; allowAdminAccessToAllCollectionItems: boolean; userIsManagedByOrganization: boolean; useRiskInsights: boolean; @@ -115,7 +115,7 @@ export class ProfileOrganizationResponse extends BaseResponse { this.accessSecretsManager = this.getResponseProperty("AccessSecretsManager"); this.limitCollectionCreation = this.getResponseProperty("LimitCollectionCreation"); this.limitCollectionDeletion = this.getResponseProperty("LimitCollectionDeletion"); - this.LimitItemDeletion = this.getResponseProperty("LimitItemDeletion"); + this.limitItemDeletion = this.getResponseProperty("LimitItemDeletion"); this.allowAdminAccessToAllCollectionItems = this.getResponseProperty( "AllowAdminAccessToAllCollectionItems", ); diff --git a/libs/common/src/auth/services/key-connector.service.spec.ts b/libs/common/src/auth/services/key-connector.service.spec.ts index a8548727fff..165dcee1ea8 100644 --- a/libs/common/src/auth/services/key-connector.service.spec.ts +++ b/libs/common/src/auth/services/key-connector.service.spec.ts @@ -368,7 +368,7 @@ describe("KeyConnectorService", () => { accessSecretsManager: false, limitCollectionCreation: true, limitCollectionDeletion: true, - LimitItemDeletion: true, + limitItemDeletion: true, allowAdminAccessToAllCollectionItems: true, flexibleCollections: false, object: "profileOrganization",