Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,24 @@ codeunit 8350 "MCP Config"
begin
MCPConfigImplementation.AllowBoundActions(ToolSystemId, Allow);
end;

/// <summary>
/// Creates a new MCP Entra Application with the specified name, description, and client ID.
/// </summary>
/// <param name="Name">The friendly name for the Entra application registration.</param>
/// <param name="Description">The description for the Entra application registration.</param>
/// <param name="ClientId">The Entra application (client) ID.</param>
procedure CreateEntraApplication(Name: Text[100]; Description: Text[250]; ClientId: Guid)
begin
MCPConfigImplementation.CreateEntraApplication(Name, Description, ClientId);
end;

/// <summary>
/// Deletes the specified MCP Entra Application.
/// </summary>
/// <param name="EntraApplicationId">The SystemId (GUID) of the Entra application to delete.</param>
procedure DeleteEntraApplication(EntraApplicationId: Guid)
begin
MCPConfigImplementation.DeleteEntraApplication(EntraApplicationId);
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -583,20 +583,38 @@ codeunit 8351 "MCP Config Implementation"
var
JsonBuilder: TextBuilder;
begin
JsonBuilder.AppendLine('{');
JsonBuilder.AppendLine(' "' + MCPPrefix + '": {');
JsonBuilder.AppendLine(' "url": "' + MCPUrl + '",');
JsonBuilder.AppendLine(' "type": "http",');
JsonBuilder.AppendLine(' "headers": {');
JsonBuilder.AppendLine(' "TenantId": "' + TenantId + '",');
JsonBuilder.AppendLine(' "EnvironmentName": "' + EnvironmentName + '",');
JsonBuilder.AppendLine(' "Company": "' + Company + '",');
JsonBuilder.AppendLine(' "ConfigurationName": "' + ConfigurationName + '"');
JsonBuilder.AppendLine(' }');
JsonBuilder.AppendLine('"' + MCPPrefix + '": {');
JsonBuilder.AppendLine(' "url": "' + MCPUrl + '",');
JsonBuilder.AppendLine(' "type": "http",');
JsonBuilder.AppendLine(' "headers": {');
JsonBuilder.AppendLine(' "TenantId": "' + TenantId + '",');
JsonBuilder.AppendLine(' "EnvironmentName": "' + EnvironmentName + '",');
JsonBuilder.AppendLine(' "Company": "' + Company + '",');
JsonBuilder.AppendLine(' "ConfigurationName": "' + ConfigurationName + '"');
JsonBuilder.AppendLine(' }');
JsonBuilder.AppendLine('}');
exit(JsonBuilder.ToText());
end;

internal procedure CreateEntraApplication(Name: Text[100]; Description: Text[250]; ClientId: Guid)
var
MCPEntraApplication: Record "MCP Entra Application";
begin
MCPEntraApplication.Name := Name;
MCPEntraApplication.Description := Description;
MCPEntraApplication."Client ID" := ClientId;
MCPEntraApplication.Insert();
end;

internal procedure DeleteEntraApplication(EntraApplicationId: Guid)
var
MCPEntraApplication: Record "MCP Entra Application";
begin
if not MCPEntraApplication.GetBySystemId(EntraApplicationId) then
exit;

MCPEntraApplication.Delete();
end;
#endregion

#if not CLEAN28
Expand All @@ -611,6 +629,7 @@ codeunit 8351 "MCP Config Implementation"

local procedure GetDimensions(MCPConfiguration: Record "MCP Configuration") Dimensions: Dictionary of [Text, Text]
begin
Dimensions.Add('Category', GetTelemetryCategory());
Dimensions.Add('MCPConfigurationName', MCPConfiguration.Name);
Dimensions.Add('Active', Format(MCPConfiguration.Active));
Dimensions.Add('UnblockEditTools', Format(MCPConfiguration.AllowProdChanges));
Expand All @@ -633,6 +652,7 @@ codeunit 8351 "MCP Config Implementation"
var
Dimensions: Dictionary of [Text, Text];
begin
Dimensions.Add('Category', GetTelemetryCategory());
Dimensions.Add('MCPConfigurationName', MCPConfiguration.Name);
if MCPConfiguration.Active <> xMCPConfiguration.Active then begin
Dimensions.Add('OldActive', Format(xMCPConfiguration.Active));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ using System.Environment.Configuration;
using System.ExternalFileStorage;
using System.Integration;
using System.Integration.Excel;
using System.MCP;
using System.Privacy;
using System.SFTPClient;

Expand All @@ -31,6 +32,7 @@ permissionset 154 "System Application - Admin"
"Edit in Excel-Admin",
"Feature Key - Admin",
"File Storage - Admin",
"MCP - Admin",
"Permissions & Licenses - Edit",
"Priv. Notice - Admin",
"Retention Policy - Admin",
Expand Down
Loading