From c39948b593b000e71643cd7e5a82af0f9c4afd2d Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Mon, 1 Apr 2024 16:44:07 -0600 Subject: [PATCH] MM-57154 - add license check to sysconsole items (#26507) * add license check to sysconsole items * backwards...strike, reverse --------- Co-authored-by: Mattermost Build --- .../src/components/admin_console/admin_definition.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/channels/src/components/admin_console/admin_definition.tsx b/webapp/channels/src/components/admin_console/admin_definition.tsx index fdf8198483..e1d2897d2b 100644 --- a/webapp/channels/src/components/admin_console/admin_definition.tsx +++ b/webapp/channels/src/components/admin_console/admin_definition.tsx @@ -218,7 +218,7 @@ export const it = { configContains: (group: keyof Partial, setting: string, word: string) => (config: Partial) => Boolean((config[group] as any)?.[setting]?.includes(word)), enterpriseReady: (config: Partial, state: any, license?: ClientLicense, enterpriseReady?: boolean) => Boolean(enterpriseReady), licensed: (config: Partial, state: any, license?: ClientLicense) => license?.IsLicensed === 'true', - cloudLicensed: (config: Partial, state: any, license?: ClientLicense) => Boolean(license?.IsLicenced && isCloudLicense(license)), + cloudLicensed: (config: Partial, state: any, license?: ClientLicense) => Boolean(license?.IsLicensed && isCloudLicense(license)), licensedForFeature: (feature: string) => (config: Partial, state: any, license?: ClientLicense) => Boolean(license?.IsLicensed && license[feature] === 'true'), licensedForSku: (skuName: string) => (config: Partial, state: any, license?: ClientLicense) => Boolean(license?.IsLicensed && license.SkuShortName === skuName), licensedForCloudStarter: (config: Partial, state: any, license?: ClientLicense) => Boolean(license?.IsLicensed && isCloudLicense(license) && license.SkuShortName === LicenseSkus.Starter), @@ -725,6 +725,7 @@ const AdminDefinition: AdminDefinitionType = { disabled_help_text: defineMessage({id: 'admin.service.forward80To443Description.disabled', defaultMessage: 'Forwards all insecure traffic from port 80 to secure port 443. Not recommended when using a proxy server. This setting cannot be enabled until your server is [listening](#ServiceSettings.ListenAddress) on port 443.'}), disabled_help_text_markdown: true, isDisabled: it.any( + it.cloudLicensed, it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.ENVIRONMENT.WEB_SERVER)), it.not(it.stateMatches('ServiceSettings.ListenAddress', /:443$/)), ), @@ -894,6 +895,7 @@ const AdminDefinition: AdminDefinitionType = { title: defineMessage({id: 'admin.sidebar.database', defaultMessage: 'Database'}), searchableStrings: databaseSearchableStrings, isHidden: it.any( + it.cloudLicensed, it.configIsTrue('ExperimentalSettings', 'RestrictSystemAdmin'), it.not(it.userHasReadPermissionOnResource(RESOURCE_KEYS.ENVIRONMENT.DATABASE)), ),