diff --git a/src/System Application/App/Azure AD Graph/app.json b/src/System Application/App/Azure AD Graph/app.json index 553d80d690..b6b3af6790 100644 --- a/src/System Application/App/Azure AD Graph/app.json +++ b/src/System Application/App/Azure AD Graph/app.json @@ -22,6 +22,12 @@ "name": "DotNet Aliases", "publisher": "Microsoft", "version": "27.3.0.0" + }, + { + "id": "1a023056-d6fe-41af-a16e-da7d678cf266", + "name": "Server Settings", + "publisher": "Microsoft", + "version": "27.3.0.0" } ], "internalsVisibleTo": [ diff --git a/src/System Application/App/Azure AD Graph/src/AzureADGraphImpl.Codeunit.al b/src/System Application/App/Azure AD Graph/src/AzureADGraphImpl.Codeunit.al index 6c6518b05d..953ac14171 100644 --- a/src/System Application/App/Azure AD Graph/src/AzureADGraphImpl.Codeunit.al +++ b/src/System Application/App/Azure AD Graph/src/AzureADGraphImpl.Codeunit.al @@ -7,6 +7,7 @@ namespace System.Azure.Identity; using System; using System.Environment; +using System.Environment.Configuration; codeunit 9014 "Azure AD Graph Impl." { @@ -262,9 +263,10 @@ codeunit 9014 "Azure AD Graph Impl." [NonDebuggable] local procedure Initialize(): Boolean var + ServerSetting: Codeunit "Server Setting"; Handled: Boolean; begin - if not EnvironmentInformation.IsSaaS() then + if not (EnvironmentInformation.IsSaaS() or ServerSetting.GetEnableEntraGroupsOnPrem()) then exit(false); if IsGraphInitialized then diff --git a/src/System Application/App/Server Settings/src/ServerSetting.Codeunit.al b/src/System Application/App/Server Settings/src/ServerSetting.Codeunit.al index 86f8986314..8b7b60e495 100644 --- a/src/System Application/App/Server Settings/src/ServerSetting.Codeunit.al +++ b/src/System Application/App/Server Settings/src/ServerSetting.Codeunit.al @@ -35,6 +35,14 @@ codeunit 6723 "Server Setting" exit(ServerSettingImpl.GetIsSaasExcelAddinEnabled()); end; + /// Checks whether Entra Groups are enabled on-premises. + /// True if enabled; otherwise, false. + /// Gets the value of the server setting EnableEntraGroupsOnPrem. + procedure GetEnableEntraGroupsOnPrem(): Boolean + begin + exit(ServerSettingImpl.GetEnableEntraGroupsOnPrem()); + end; + /// Checks whether the API Services are enabled. /// True if enabled; otherwise, false. /// Gets the value of the server setting ApiServicesEnabled. diff --git a/src/System Application/App/Server Settings/src/ServerSettingImpl.Codeunit.al b/src/System Application/App/Server Settings/src/ServerSettingImpl.Codeunit.al index cfa448bf86..996651ccd9 100644 --- a/src/System Application/App/Server Settings/src/ServerSettingImpl.Codeunit.al +++ b/src/System Application/App/Server Settings/src/ServerSettingImpl.Codeunit.al @@ -38,6 +38,13 @@ codeunit 3703 "Server Setting Impl." exit(SaasExcelAddinEnabled); end; + procedure GetEnableEntraGroupsOnPrem() EnableEntraGroupsOnPrem: Boolean + begin + InitializeConfigSettings(); + EnableEntraGroupsOnPrem := ALConfigSettings.EnableEntraGroupsOnPrem(); + exit(EnableEntraGroupsOnPrem); + end; + procedure GetApiServicesEnabled() ApiEnabled: Boolean begin InitializeConfigSettings();