diff --git a/packages/api-aco/__tests__/utils/createTestWcpLicense.ts b/packages/api-aco/__tests__/utils/createTestWcpLicense.ts index 0c92c342cff..51eb5f98b2c 100644 --- a/packages/api-aco/__tests__/utils/createTestWcpLicense.ts +++ b/packages/api-aco/__tests__/utils/createTestWcpLicense.ts @@ -32,6 +32,9 @@ export const createTestWcpLicense = (): DecryptedWcpProjectLicense => { [PROJECT_PACKAGE_FEATURE_NAME.AUDIT_LOGS]: { enabled: false }, + [PROJECT_PACKAGE_FEATURE_NAME.RECORD_LOCKING]: { + enabled: false + }, [PROJECT_PACKAGE_FEATURE_NAME.SEATS]: { enabled: true, options: { diff --git a/packages/api-page-builder-aco/__tests__/utils/createTestWcpLicense.ts b/packages/api-page-builder-aco/__tests__/utils/createTestWcpLicense.ts index 0c92c342cff..51eb5f98b2c 100644 --- a/packages/api-page-builder-aco/__tests__/utils/createTestWcpLicense.ts +++ b/packages/api-page-builder-aco/__tests__/utils/createTestWcpLicense.ts @@ -32,6 +32,9 @@ export const createTestWcpLicense = (): DecryptedWcpProjectLicense => { [PROJECT_PACKAGE_FEATURE_NAME.AUDIT_LOGS]: { enabled: false }, + [PROJECT_PACKAGE_FEATURE_NAME.RECORD_LOCKING]: { + enabled: false + }, [PROJECT_PACKAGE_FEATURE_NAME.SEATS]: { enabled: true, options: { diff --git a/packages/api-wcp/__tests__/context.test.ts b/packages/api-wcp/__tests__/context.test.ts index 0d15147467d..fdcbb4a54b5 100644 --- a/packages/api-wcp/__tests__/context.test.ts +++ b/packages/api-wcp/__tests__/context.test.ts @@ -25,6 +25,8 @@ describe("context", () => { canUseFolderLevelPermissions: expect.any(Function), canUsePrivateFiles: expect.any(Function), canUseTeams: expect.any(Function), + canUseAuditLogs: expect.any(Function), + canUseRecordLocking: expect.any(Function), decrementSeats: expect.any(Function), incrementTenants: expect.any(Function), decrementTenants: expect.any(Function) diff --git a/packages/api-wcp/src/createWcp.ts b/packages/api-wcp/src/createWcp.ts index d9b9f234b1a..b52457a6dab 100644 --- a/packages/api-wcp/src/createWcp.ts +++ b/packages/api-wcp/src/createWcp.ts @@ -147,6 +147,14 @@ export const createWcp = async (params: CreateWcpParams = {}): Promise boolean; canUsePrivateFiles: () => boolean; canUseFolderLevelPermissions: () => boolean; + canUseAuditLogs: () => boolean; + canUseRecordLocking: () => boolean; } export function useWcp(): UseWcpHook { @@ -65,12 +67,22 @@ export function useWcp(): UseWcpHook { return advancedAccessControlLayer.options.privateFiles; }; + const canUseAuditLogs = () => { + return canUseFeature("auditLogs"); + }; + + const canUseRecordLocking = () => { + return canUseFeature("recordLocking"); + }; + return { getProject, canUseFeature, canUseAacl, canUseTeams, canUseFolderLevelPermissions, - canUsePrivateFiles + canUsePrivateFiles, + canUseAuditLogs, + canUseRecordLocking }; } diff --git a/packages/app-wcp/src/types.ts b/packages/app-wcp/src/types.ts index 764085287ff..e5c233db057 100644 --- a/packages/app-wcp/src/types.ts +++ b/packages/app-wcp/src/types.ts @@ -25,6 +25,9 @@ export type WcpProjectPackage = { auditLogs: { enabled: boolean; }; + recordLocking: { + enabled: boolean; + }; }; }; diff --git a/packages/wcp/src/index.ts b/packages/wcp/src/index.ts index 571b50fceb7..7a4dedb1b5d 100644 --- a/packages/wcp/src/index.ts +++ b/packages/wcp/src/index.ts @@ -7,5 +7,6 @@ export const WCP_FEATURE_LABEL = { multiTenancy: "Multi-tenancy", advancedPublishingWorkflow: "Advanced Publishing Workflow (APW)", advancedAccessControlLayer: "Advanced Access Control Layer (ACL)", - auditLogs: "Audit Logs" + auditLogs: "Audit Logs", + recordLocking: "Record Locking" }; diff --git a/packages/wcp/src/types.ts b/packages/wcp/src/types.ts index d06f108b2ab..d2671a17a02 100644 --- a/packages/wcp/src/types.ts +++ b/packages/wcp/src/types.ts @@ -17,7 +17,8 @@ export enum PROJECT_PACKAGE_FEATURE_NAME { APW = "advancedPublishingWorkflow", AACL = "advancedAccessControlLayer", AL = "auditLogs", - AUDIT_LOGS = "auditLogs" + AUDIT_LOGS = "auditLogs", + RECORD_LOCKING = "recordLocking" } export enum MT_OPTIONS_MAX_COUNT_TYPE { @@ -49,6 +50,9 @@ export interface ProjectPackageFeatures { [PROJECT_PACKAGE_FEATURE_NAME.AUDIT_LOGS]: { enabled: boolean; }; + [PROJECT_PACKAGE_FEATURE_NAME.RECORD_LOCKING]: { + enabled: boolean; + }; [PROJECT_PACKAGE_FEATURE_NAME.AACL]: { enabled: boolean; options: { teams: boolean; privateFiles: boolean; folderLevelPermissions: boolean };