8000 Cleanup system app code by AndreasMoth · Pull Request #397 · microsoft/BCApps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cleanup system app code #397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

8000 Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 1, 2023
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ codeunit 7771 "Azure OpenAI"
/// <param name="Endpoint">The endpoint to use for the model type.</param>
/// <param name="Deployment">The deployment to use for the endpoint.</param>
/// <param name="ApiKey">The API key to use for the endpoint.</param>
/// <remarks>Endpoint would look like: https://resource-name.openai.azure.com/
/// <remarks>Endpoint would look like: https://resource-name.openai.azure.com/
/// Deployment would look like: gpt-35-turbo-16k
/// </remarks>
[NonDebuggable]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ codeunit 7772 "Azure OpenAI Impl"
end;
else begin
WithinGeo := ALCopilotFunctions.IsWithinGeo();
// Privacy notice not set, we will not cross geo-boundries
// Privacy notice not set, we will not cross geo-boundries
if not Silent then
if not WithinGeo then begin
CopilotNotAvailable.SetCopilotCapability(Capability);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace System.AI;

/// <summary>
/// Represents the Chat Completion parameters used by the API.
/// Represents the Chat Completion parameters used by the API.
/// See more details at https://aka.ms/AAlrz36.
/// </summary>
codeunit 7761 "AOAI Chat Completion Params"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace System.AI;

/// <summary>
/// Represents the Completion parameters used by the API.
/// Represents the Completion parameters used by the API.
/// See more details at https://aka.ms/AAlsi39.
/// </summary>
codeunit 7765 "AOAI Text Completion Params"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ codeunit 7774 "Copilot Capability Impl"
CopilotSettings.Capability := CopilotCapability;
CopilotSettings."App Id" := CallerModuleInfo.Id();
CopilotSettings.Publisher := CopyStr(CallerModuleInfo.Publisher, 1, MaxStrLen(CopilotSettings.Publisher));
CopilotSettings."Availability" := CopilotAvailability;
CopilotSettings.Availability := CopilotAvailability;
CopilotSettings."Learn More Url" := LearnMoreUrl;
CopilotSettings.Status := Enum::"Copilot Status"::Active;
CopilotSettings.Insert();
Expand All @@ -73,10 +73,10 @@ codeunit 7774 "Copilot Capability Impl"
CopilotSettings.ReadIsolation(IsolationLevel::ReadCommitted);
CopilotSettings.Get(CopilotCapability, CallerModuleInfo.Id());

if CopilotSettings."Availability" <> CopilotAvailability then
if CopilotSettings.Availability <> CopilotAvailability then
CopilotSettings.Status := Enum::"Copilot Status"::Active;

CopilotSettings."Availability" := CopilotAvailability;
CopilotSettings.Availability := CopilotAvailability;
CopilotSettings."Learn More Url" := LearnMoreUrl;
CopilotSettings.Modify(true);
Commit();
Expand Down Expand Up @@ -128,7 +128,7 @@ codeunit 7774 "Copilot Capability Impl"
CopilotSettings: Record "Copilot Settings";
begin
CopilotSettings.ReadIsolation(IsolationLevel::ReadCommitted);
CopilotSettings.SetLoadFields("Status");
CopilotSettings.SetLoadFields(Status);
if not CopilotSettings.Get(CopilotCapability, AppId) then
exit(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ permissionset 1817 "Advanced Settings - Objects"
Access = Internal;
Assignable = false;

Permissions = Page "Advanced Settings" = X;
Permissions = page "Advanced Settings" = X;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ codeunit 9202 "Advanced Settings"

/// <summary>Notifies that the Open General Setup Experience has been invoked.</summary>
/// <param name="PageID">The Page ID of the page been invoked.</param>
/// <param name="Handled">The flag which if set, would stop executing the OpenGeneralSetupExperience of the assisted setup guide.</param>
/// <param name="Handled">The flag which if set, would stop executing the OpenGeneralSetupExperience of the assisted setup guide.</param>
[IntegrationEvent(false, false)]
internal procedure OnBeforeOpenGeneralSetupExperience(var PageID: Integer; var Handled: Boolean)
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ codeunit 1817 "Advanced Settings Impl."
GeneralSetupID := Page::"Advanced Settings";
AdvancedSettings.OnBeforeOpenGeneralSetupExperience(GeneralSetupID, Handled);
if not Handled then
PAGE.Run(GeneralSetupID);
Page.Run(GeneralSetupID);
Handled := true;
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ codeunit 45 "Auto Format"
/// </summary>
/// <param name="AutoFormatType">
/// A value that determines how data is formatted.
/// The values that are available are "0" and "11".
/// The values that are available are "0" and "11".
/// Use "0" to ignore the value that AutoFormatExpr passes and use the standard format for decimals instead.
/// Use "11" to apply a specific format in AutoFormatExpr without additional transformation.
/// </param>
Expand Down Expand Up @@ -58,14 +58,14 @@ codeunit 45 "Auto Format"
end;

/// <summary>
/// Event that is called to resolve cases for AutoFormatTypes other that "0" and "11".
/// Event that is called to resolve cases for AutoFormatTypes other that "0" and "11".
/// Subscribe to this event if you want to introduce new AutoFormatTypes.
/// </summary>
/// <param name="AutoFormatType">A value that determines how data is formatted.</param>
/// <param name="AutoFormatExpr">An expression that specifies how to format data.</param>
/// <param name="Result">
/// The resolved expression that defines data formatting.
/// For example '&lt;Precision,4:4&gt;&lt;Standard Format,2&gt; suffix' that depending on your regional settings
/// For example '&lt;Precision,4:4&gt;&lt;Standard Format,2&gt; suffix' that depending on your regional settings
/// will format decimal into "-12345.6789 suffix" or "-12345,6789 suffix".
/// </param>
/// <param name="Resolved">A value that describes whether the data formatting expression is correct.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ codeunit 9012 "Azure AD Graph"
/// </summary>
/// <param name="UserInfo">The user.</param>
/// <param name="UserAssignedPlans">The assigned plans for the user.</param>
/// <remarks>If the provided user is null, the output parameter holding the assigned plans remains unchanged.</remarks>
/// <remarks>If the provided user is null, the output parameter holding the assigned plans remains unchanged.</remarks>
[Scope('OnPrem')]
[NonDebuggable]
procedure GetUserAssignedPlans(UserInfo: DotNet UserInfo; var UserAssignedPlans: DotNet GenericList1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ permissionset 774 "Azure AD Plan - Objects"
Access = Internal;
Assignable = false;

Permissions = Page "Custom Permission Set In Plan" = X,
Permissions = page "Custom Permission Set In Plan" = X,
#if not CLEAN22
#pragma warning disable AL0432
#endif
Page "Default Permission Set In Plan" = X,
page "Default Permission Set In Plan" = X,
#if not CLEAN22
#pragma warning restore AL0432
#endif
Page "Plan Configuration Card" = X,
Page "Plan Configuration List" = X,
Page "Plan Configurations Part" = X,
Page "User Plan Members FactBox" = X,
Page "User Plan Members" = X,
Page "User Plans FactBox" = X;
page "Plan Configuration Card" = X,
page "Plan Configuration List" = X,
page "Plan Configurations Part" = X,
page "User Plan Members FactBox" = X,
page "User Plan Members" = X,
page "User Plans FactBox" = X;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissionset 9016 "Azure AD Plan - Read"
IncludedPermissionSets = "Azure AD Plan - Objects",
"Azure AD User - View";

Permissions = tabledata Company = r,
tabledata User = r,
tabledata "Access Control" = r;
Permissions = tabledata "Access Control" = r,
tabledata Company = r,
tabledata User = r;
}
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ codeunit 9016 "Azure AD Plan"
end;

/// <summary>
/// Returns true if there are incompatible plans in the system.
/// Returns true if there are incompatible plans in the system.
/// </summary>
/// <returns>Returns true if there are incompatible plans in the system. </returns>
[Scope('OnPrem')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ codeunit 9018 "Azure AD Plan Impl."
InherentEntitlements = X;
InherentPermissions = X;

Permissions = TableData Company = r,
TableData Plan = rimd,
TableData "User Plan" = rimd,
TableData User = r,
TableData "User Personalization" = rm;
Permissions = tabledata Company = r,
tabledata Plan = rimd,
tabledata User = r,
tabledata "User Personalization" = rm,
tabledata "User Plan" = rimd;

var
UserLoginTimeTracker: Codeunit "User Login Time Tracker";
Expand Down Expand Up @@ -133,7 +133,7 @@ codeunit 9018 "Azure AD Plan Impl."
TempDummyPlan: Record Plan temporary;
GraphUserInfo: DotNet UserInfo;
begin
if AzureADGraphUser.GetGraphUser(UserSecurityID, true, GraphUserInfo) then
if AzureADGraphUser.GetGraphUser(UserSecurityId, true, GraphUserInfo) then
UpdateUserPlans(UserSecurityId, GraphUserInfo, AppendPermissionsOnNewPlan, RemovePermissionsOnDeletePlan)
else
if RemovePlansOnDeleteUser then
Expand Down Expand Up @@ -426,7 +426,7 @@ codeunit 9018 "Azure AD Plan Impl."
exit;

repeat
TempNavUserPlan.COPY(NavUserPlan, false);
TempNavUserPlan.Copy(NavUserPlan, false);
TempNavUserPlan.Insert();
until NavUserPlan.Next() = 0;

Expand Down Expand Up @@ -466,7 +466,7 @@ codeunit 9018 "Azure AD Plan Impl."
end;

[NonDebuggable]
local procedure GetGraphUserPlans(var TempPlan: Record "Plan" temporary; var GraphUserInfo: DotNet UserInfo)
local procedure GetGraphUserPlans(var TempPlan: Record Plan temporary; var GraphUserInfo: DotNet UserInfo)
var
PlanIds: Codeunit "Plan Ids";
AssignedPlan: DotNet ServicePlanInfo;
Expand Down Expand Up @@ -510,7 +510,7 @@ codeunit 9018 "Azure AD Plan Impl."
// Check if the user is a member of the Device group
if IsDeviceRole(GraphUserInfo) then begin
// Only assign the device plan if the user doesn't have any other plans (except possibly Internal Admin or M365 Collaboration)
TempPlan.SetFilter("Plan ID", '<>%1&<>%2&<>%3', PlanIDs.GetGlobalAdminPlanId(), PlanIds.GetD365AdminPlanId(), PlanIDs.GetMicrosoft365PlanId());
TempPlan.SetFilter("Plan ID", '<>%1&<>%2&<>%3', PlanIds.GetGlobalAdminPlanId(), PlanIds.GetD365AdminPlanId(), PlanIds.GetMicrosoft365PlanId());

if TempPlan.IsEmpty() then begin
// Remove the Internal Admin and M365 Collaboration plans, if assigned
Expand Down Expand Up @@ -539,7 +539,7 @@ codeunit 9018 "Azure AD Plan Impl."
[NonDebuggable]
local procedure IsInternalAdmin(var GraphUserInfo: DotNet UserInfo): Boolean
var
PlanIds: Codeunit "Plan IDs";
PlanIds: Codeunit "Plan Ids";
DirectoryRole: DotNet RoleInfo;
RoleId: Guid;
begin
Expand Down Expand Up @@ -588,8 +588,8 @@ codeunit 9018 "Azure AD Plan Impl."
[NonDebuggable]
procedure IsBCServicePlan(ServicePlanId: Guid): Boolean
var
Plan: Record "Plan";
PlanIds: Codeunit "Plan IDs";
Plan: Record Plan;
PlanIds: Codeunit "Plan Ids";
Skip: Boolean;
IsPlanFound: Boolean;
begin
Expand All @@ -611,17 +611,17 @@ codeunit 9018 "Azure AD Plan Impl."
[NonDebuggable]
local procedure GetAzureUserPlanRoleCenterId(UserSecurityID: Guid): Integer
var
TempPlan: Record "Plan" temporary;
TempPlan: Record Plan temporary;
User: Record User;
GraphUserInfo: DotNet UserInfo;
begin
if not User.Get(UserSecurityID) then begin
Session.LogMessage('0000DUD', StrSubstNo(UserNotInUserTableTxt, UserSecurityID()), Verbosity::Warning, DataClassification::EndUserPseudonymousIdentifiers, TelemetryScope::ExtensionPublisher, 'Category', UserSetupCategoryTxt);
Session.LogMessage('0000DUD', StrSubstNo(UserNotInUserTableTxt, UserSecurityId()), Verbosity::Warning, DataClassification::EndUserPseudonymousIdentifiers, TelemetryScope::ExtensionPublisher, 'Category', UserSetupCategoryTxt);
exit(0);
end;

if not AzureADGraphUser.GetGraphUser(UserSecurityID, GraphUserInfo) then begin
Session.LogMessage('0000DUE', StrSubstNo(AzureGraphUserNotFoundTxt, UserSecurityID()), Verbosity::Warning, DataClassification::EndUserPseudonymousIdentifiers, TelemetryScope::ExtensionPublisher, 'Category', UserSetupCategoryTxt);
Session.LogMessage('0000DUE', StrSubstNo(AzureGraphUserNotFoundTxt, UserSecurityId()), Verbosity::Warning, DataClassification::EndUserPseudonymousIdentifiers, TelemetryScope::ExtensionPublisher, 'Category', UserSetupCategoryTxt);
exit(0);
end;

Expand All @@ -634,7 +634,7 @@ codeunit 9018 "Azure AD Plan Impl."
exit(0);
end;

Session.LogMessage('0000DUC', StrSubstNo(AzurePlanRoleCenterFoundTxt, TempPlan."Role Center ID", UserSecurityID()), Verbosity::Normal,
Session.LogMessage('0000DUC', StrSubstNo(AzurePlanRoleCenterFoundTxt, TempPlan."Role Center ID", UserSecurityId()), Verbosity::Normal,
DataClassification::EndUserPseudonymousIdentifiers, TelemetryScope::ExtensionPublisher, 'Category', UserSetupCategoryTxt);

exit(TempPlan."Role Center ID");
Expand Down Expand Up @@ -721,7 +721,7 @@ codeunit 9018 "Azure AD Plan Impl."
// Only remove SUPER if other permissions are granted (to avoid user lockout)
if UserGroupsAdded and (not UserHadBeenSetupBefore) then begin
if IsPlanConfigurationCustomized then begin
// For newly-created users clear the company in case they are logged in to a company they don't have permissions for.
// For newly-created users clear the company in case they are logged in to a company they don't have permissions for.
// Clearing the company in user personalization will make platform pick the right company on next login.
UserPersonalization.LockTable();
if UserPersonalization.Get(UserSecurityID) and (UserPersonalization.Company <> '') then begin
Expand All @@ -743,15 +743,15 @@ codeunit 9018 "Azure AD Plan Impl."
end;

[NonDebuggable]
local procedure AddToTempPlan(ServicePlanId: Guid; ServicePlanName: Text; var TempPlan: Record "Plan" temporary)
local procedure AddToTempPlan(ServicePlanId: Guid; ServicePlanName: Text; var TempPlan: Record Plan temporary)
var
Plan: Record "Plan";
Plan: Record Plan;
Handled: Boolean;
begin
if TempPlan.GET(ServicePlanId) then
if TempPlan.Get(ServicePlanId) then
exit;

if Plan.GET(ServicePlanId) then;
if Plan.Get(ServicePlanId) then;

TempPlan.Init();
TempPlan."Plan ID" := ServicePlanId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ page 9058 "Custom Permission Set In Plan"

layout
{
area(content)
area(Content)
{
#if not CLEAN22
group("Assigned Permission Sets")
Expand All @@ -37,7 +37,7 @@ page 9058 "Custom Permission Set In Plan"

repeater(Group)
{
field("Plan Id"; Rec."Plan Id")
field("Plan Id"; Rec."Plan ID")
{
ApplicationArea = All;
Visible = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ page 9827 "Default Permission Set In Plan"

layout
{
area(content)
area(Content)
{
repeater(PermissionSet)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ codeunit 9085 "Microsoft 365 License"
InherentEntitlements = X;
InherentPermissions = X;

/// <summary>
/// <summary>
/// Assign D365 Read Permission.
/// </summary>
/// <param name="ShowNotification">Show notification about license information regarding users in BC.</param>
/// <param name="ShowNotification">Show notification about license information regarding users in BC.</param>
procedure AssignMicrosoft365ReadPermission(ShowNotification: Boolean)
begin
Microsoft365LicenseImpl.AssignMicrosoft365ReadPermission(ShowNotification);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ page 9069 "Plan Configuration Card"

layout
{
area(content)
area(Content)
{
grid(GeneralGrid)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ codeunit 9822 "Plan Configuration Impl."
exit;

repeat
if AccessControl.Get(UserSecurityID, CustomPermissionSetInPlan."Role ID", CustomPermissionSetInPlan."Company Name", CustomPermissionSetInPlan.Scope, CustomPermissionSetInPlan."App ID") then
if AccessControl.Get(UserSecurityId, CustomPermissionSetInPlan."Role ID", CustomPermissionSetInPlan."Company Name", CustomPermissionSetInPlan.Scope, CustomPermissionSetInPlan."App ID") then
#if not CLEAN22
#pragma warning disable AA0013
begin
Expand Down Expand Up @@ -210,7 +210,7 @@ codeunit 9822 "Plan Configuration Impl."
exit;

repeat
AccessControl.SetRange("User Security ID", UserSecurityID);
AccessControl.SetRange("User Security ID", UserSecurityId);
AccessControl.SetRange("Role ID", DefaultPermissionSetInPlan."Role ID");
AccessControl.SetRange(Scope, DefaultPermissionSetInPlan.Scope);
AccessControl.SetRange("App ID", DefaultPermissionSetInPlan."App ID");
Expand Down Expand Up @@ -439,7 +439,7 @@ codeunit 9822 "Plan Configuration Impl."
AccessControl: Record "Access Control";
NullGuid: Guid;
begin
AccessControl.SetRange("User Security ID", UserSecurityID);
AccessControl.SetRange("User Security ID", UserSecurityId);
AccessControl.SetRange("Role ID", RoleId);
AccessControl.SetRange("Company Name", Company);
AccessControl.SetRange(Scope, Scope);
Expand All @@ -456,7 +456,7 @@ codeunit 9822 "Plan Configuration Impl."

if AccessControl.IsEmpty() then begin
AccessControl.Init();
AccessControl."User Security ID" := UserSecurityID;
AccessControl."User Security ID" := UserSecurityId;
AccessControl."Role ID" := RoleId;
AccessControl."Company Name" := Company;
AccessControl.Scope := Scope;
Expand Down
Loading
0