-
Notifications
You must be signed in to change notification settings - Fork 371
Uptake/rename license configurations #6404
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.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1f9c041
3566848
6f9d090
229f5d4
ff30775
ce6ab58
5d3f1d1
1287a74
8d59a6b
e938195
eea1dd7
0040471
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -667,7 +667,7 @@ codeunit 9018 "Azure AD Plan Impl." | |||||
| begin | ||||||
| case true of | ||||||
| AzureADGraphUser.IsUserDelegatedAdmin(): | ||||||
| PlanId := PlanIds.GetDelegatedAdminPlanId(); | ||||||
| PlanId := PlanIds.GetGlobalAdminPlanId(); | ||||||
| AzureADGraphUser.IsUserDelegatedHelpdesk(): | ||||||
| PlanId := PlanIds.GetHelpDeskPlanId(); | ||||||
| else begin | ||||||
|
|
@@ -805,7 +805,7 @@ codeunit 9018 "Azure AD Plan Impl." | |||||
| begin | ||||||
| exit( | ||||||
| IsPlanAssignedToUser(PlanIds.GetGlobalAdminPlanId(), SecurityID) | ||||||
| or IsPlanAssignedToUser(PlanIds.GetDelegatedAdminPlanId(), SecurityID) | ||||||
| or IsPlanAssignedToUser(PlanIds.GetGlobalAdminPlanId(), SecurityID) | ||||||
|
||||||
| or IsPlanAssignedToUser(PlanIds.GetGlobalAdminPlanId(), SecurityID) | |
| or IsPlanAssignedToUser(PlanIds.GetDelegatedGlobalAdminPlanId(), SecurityID) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,28 +105,52 @@ codeunit 9027 "Plan Ids" | |
| exit(ExternalAccountantPlanGUIDTxt); | ||
| end; | ||
|
|
||
| #if not CLEAN32 | ||
| /// <summary> | ||
| /// Returns the ID for the Delegated Admin agent - Partner plan. | ||
| /// </summary> | ||
| /// <returns>The ID for the Delegated Admin agent - Partner plan.</returns> | ||
| [Obsolete('Use GetDelegatedGlobalAdminPlanId instead', '28.0')] | ||
| procedure GetDelegatedAdminPlanId(): Guid | ||
| begin | ||
| exit(DelegatedAdminGUIDTxt); | ||
| end; | ||
| #endif | ||
|
|
||
| /// <summary> | ||
| /// Returns the ID for the Delegated Admin agent - Partner plan. | ||
| /// </summary> | ||
| /// <returns>The ID for the Delegated Admin agent - Partner plan.</returns> | ||
| procedure GetDelegatedGlobalAdminPlanId(): Guid | ||
|
BenPlunk marked this conversation as resolved.
|
||
| begin | ||
| exit(DelegatedAdminGUIDTxt); | ||
| end; | ||
|
Comment on lines
+120
to
+127
|
||
|
|
||
| #if not CLEAN32 | ||
| /// <summary> | ||
| /// Returns the ID for the Delegated BC Admin agent - Partner plan. | ||
| /// </summary> | ||
| /// <returns>The ID for the Delegated BC Admin agent - Partner plan.</returns> | ||
| [Obsolete('Use GetD365BCAdminPlanId instead', '28.0')] | ||
| procedure GetDelegatedBCAdminPlanId(): Guid | ||
| begin | ||
| exit(BCAdminPartnerGUIDTxt); | ||
| end; | ||
| #endif | ||
|
|
||
| /// <summary> | ||
| /// Returns the ID for the Delegated BC Admin agent - Partner plan. | ||
| /// </summary> | ||
| /// <returns>The ID for the Delegated BC Admin agent - Partner plan.</returns> | ||
| procedure GetD365BCAdminPlanId(): Guid | ||
|
BenPlunk marked this conversation as resolved.
|
||
| begin | ||
| exit(BCAdminPartnerGUIDTxt); | ||
| end; | ||
|
Comment on lines
+141
to
+148
|
||
|
|
||
| /// <summary> | ||
| /// Returns the ID for the Internal BC Administrator plan. | ||
| /// Returns the ID for the D365 Business Central Administrator plan. | ||
| /// </summary> | ||
| /// <returns>The ID for the Internal BC Administrator plan.</returns> | ||
| /// <returns>The ID for the D365 Business Central Administrator plan.</returns> | ||
| procedure GetBCAdminPlanId(): Guid | ||
| begin | ||
| exit(BCAdminGUIDTxt); | ||
|
|
||
|
BenPlunk marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,6 +24,7 @@ codeunit 9057 "Plan Upgrade" | |||||||||
| begin | ||||||||||
| UpdateSubscriptionPlan(); | ||||||||||
| RenamePlansAndDeleteOldPlans(); | ||||||||||
| RenameDelegatedAdminPlans(); | ||||||||||
| RenameTeamMemberPlan(); | ||||||||||
| RenameDevicePlan(); | ||||||||||
| AddPremiumPartnerSandbox(); | ||||||||||
|
|
@@ -86,7 +87,7 @@ codeunit 9057 "Plan Upgrade" | |||||||||
| RenameOrCreatePlan(PlanIds.GetExternalAccountantPlanId(), 'Dynamics 365 Business Central External Accountant'); | ||||||||||
| RenameOrCreatePlan(PlanIds.GetPremiumISVPlanId(), 'Dynamics 365 Business Central Premium - Embedded'); | ||||||||||
| RenameOrCreatePlan(PlanIds.GetViralSignupPlanId(), 'Dynamics 365 Business Central for IWs'); | ||||||||||
| RenameOrCreatePlan(PlanIds.GetDelegatedAdminPlanId(), 'Delegated Admin agent - Partner'); | ||||||||||
| RenameOrCreatePlan(PlanIds.GetGlobalAdminPlanId(), 'Delegated Admin agent - Partner'); | ||||||||||
|
||||||||||
| RenameOrCreatePlan(PlanIds.GetGlobalAdminPlanId(), 'Delegated Admin agent - Partner'); | |
| RenameOrCreatePlan(PlanIds.GetDelegatedGlobalAdminPlanId(), 'Delegated Admin agent - Partner'); |
Copilot
AI
Apr 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RenameDelegatedAdminPlans renames GetGlobalAdminPlanId() twice (to 'Global Administrator' and then to 'Delegated Global Administrator'). The second rename should target the delegated admin plan GUID (GetDelegatedGlobalAdminPlanId()), otherwise it will overwrite the global admin plan name and never rename the delegated plan. Also note that 'Delegated Dynamics 365 Business Central Administrator' exceeds the Plan.Name length (50) and will be truncated by CopyStr, so the resulting display name will not match the intended role name.
| RenameOrCreatePlan(PlanIds.GetD365BCAdminPlanId(), 'Delegated Dynamics 365 Business Central Administrator'); | |
| RenameOrCreatePlan(PlanIds.GetGlobalAdminPlanId(), 'Delegated Global Administrator'); | |
| RenameOrCreatePlan(PlanIds.GetD365BCAdminPlanId(), 'Delegated D365 Business Central Administrator'); | |
| RenameOrCreatePlan(PlanIds.GetDelegatedGlobalAdminPlanId(), 'Delegated Global Administrator'); |
Copilot
AI
Apr 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In AddBCAdmin, the delegated BC admin plan name is set to 'Delegated Dynamics 365 Business Central Admin', while Plan Installer creates 'Delegated D365 Business Central Administrator' and RenameDelegatedAdminPlans tries to rename to yet another variant. Please align on a single <=50-char display name across install + upgrade paths to avoid inconsistent names and accidental truncation.
| PlanName := 'Delegated Dynamics 365 Business Central Admin'; | |
| PlanName := 'Delegated D365 Business Central Administrator'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,15 @@ codeunit 9058 "Plan Upgrade Tag" | |
| exit('MS-329421-RenamePlans-20211028'); | ||
| end; | ||
|
|
||
| /// <summary> | ||
| /// Returns the rename delegated admin plans upgrade tag. | ||
| /// </summary> | ||
| /// <returns>The rename delegated admin plans upgrade tag.</returns> | ||
| internal procedure GetRenameDelegatedAdminPlansUpgradeTag(): Code[250] | ||
| begin | ||
| exit('MS-582117-RenameDelegatedAdminPlans-20260128'); | ||
| end; | ||
|
Comment on lines
+52
to
+59
|
||
|
|
||
| /// <summary> | ||
| /// Returns the rename team member plan upgrade tag. | ||
| /// </summary> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -29,10 +29,10 @@ codeunit 776 "Plan User Details" | |||||
| end; | ||||||
|
|
||||||
| UserDetails."User Plans" := CopyStr(UserPlansTextBuilder.ToText().TrimEnd(' ; '), 1, MaxStrLen(UserDetails."User Plans")); | ||||||
| UserDetails."Is Delegated" := AzureADPlan.IsPlanAssignedToUser(PlanIds.GetDelegatedAdminPlanId(), UserSecId) or | ||||||
| UserDetails."Is Delegated" := AzureADPlan.IsPlanAssignedToUser(PlanIds.GetGlobalAdminPlanId(), UserSecId) or | ||||||
|
||||||
| UserDetails."Is Delegated" := AzureADPlan.IsPlanAssignedToUser(PlanIds.GetGlobalAdminPlanId(), UserSecId) or | |
| UserDetails."Is Delegated" := AzureADPlan.IsPlanAssignedToUser(PlanIds.GetDelegatedGlobalAdminPlanId(), UserSecId) or |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -208,10 +208,10 @@ codeunit 9017 "Azure AD User Mgmt. Impl." | |||||
| var | ||||||
| PlanIds: Codeunit "Plan Ids"; | ||||||
| begin | ||||||
| exit(AzureADPlan.IsPlanAssignedToUser(PlanIds.GetDelegatedAdminPlanId(), UserSecID) or | ||||||
| exit(AzureADPlan.IsPlanAssignedToUser(PlanIds.GetGlobalAdminPlanId(), UserSecID) or | ||||||
|
||||||
| exit(AzureADPlan.IsPlanAssignedToUser(PlanIds.GetGlobalAdminPlanId(), UserSecID) or | |
| exit(AzureADPlan.IsPlanAssignedToUser(PlanIds.GetDelegatedGlobalAdminPlanId(), UserSecID) or |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -238,9 +238,9 @@ codeunit 9029 "Azure AD User Sync Impl." | |||||
| end; | ||||||
|
|
||||||
| // If the user's plans are any of the following: | ||||||
| // - Internal Administrator (Global Administrator or Dynamics 365 Administrator or BC Administrator) | ||||||
| // - Global Administrator (Global Administrator or Dynamics 365 Administrator or BC Administrator) | ||||||
|
||||||
| // - Global Administrator (Global Administrator or Dynamics 365 Administrator or BC Administrator) | |
| // - Global Administrator (Global Administrator or Dynamics 365 Administrator or D365 Business Central Administrator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delegated admins are being assigned
PlanIds.GetGlobalAdminPlanId()here.GetGlobalAdminPlanId()is the tenant Global Administrator role GUID, not the delegated admin plan GUID (DelegatedAdminGUIDTxt). This will assign the wrong plan to delegated admins and can grant/track the wrong entitlements. UsePlanIds.GetDelegatedGlobalAdminPlanId()for the delegated-admin path.