Skip to content

Commit 9b7f1ea

Browse files
authored
[releases/26.1] M365 Sync may fail as multiple identical permissions are added to the same temporary table (#3624)
In certain situations when we sync users from M365 they have multiple identical permissions. This means we will attempt to add the same access control to TempAccessControlWithDefaultPermissions multiple times. Solution, if it's already added once, don't re-add it. Fixes [AB#575638](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/575638)
1 parent b536295 commit 9b7f1ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/System Application/App/Azure AD User Management/src/AzureADUserMgmtImpl.Codeunit.al

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ codeunit 9017 "Azure AD User Mgmt. Impl."
299299

300300
repeat
301301
TempAccessControlWithDefaultPermissions.Copy(AccessControl);
302-
TempAccessControlWithDefaultPermissions.Insert();
302+
if not TempAccessControlWithDefaultPermissions.Insert() then; // Ignore multiple plans referencing the same permission
303303
until AccessControl.Next() = 0;
304304
until PermissionSetInPlanBuffer.Next() = 0;
305305
end;

0 commit comments

Comments
 (0)