Skip to content

Commit

Permalink
Fix for CA policies with external tenants
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Jul 27, 2023
1 parent a2d5f5d commit bbb5134
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion AddCAPolicy/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ $JSONObj = $request.body.RawJSON | ConvertFrom-Json | Select-Object * -ExcludePr
Remove-EmptyArrays $JSONObj
#Remove context as it does not belong in the payload.
$JsonObj.grantControls.PSObject.Properties.Remove('[email protected]')
$JsonObj.conditions.users.excludeGuestsOrExternalUsers.externalTenants.PSObject.Properties.Remove('@odata.type')
if ($JSONObj.conditions.users.excludeGuestsOrExternalUsers.externalTenants.Members) {
$JsonObj.conditions.users.excludeGuestsOrExternalUsers.externalTenants.PSObject.Properties.Remove('@odata.context')
$JsonObj.conditions.users.excludeGuestsOrExternalUsers.externalTenants.PSObject.Properties.Remove('@odata.type')
}
$RawJSON = $JSONObj | ConvertTo-Json -Depth 10

$results = foreach ($Tenant in $tenants) {
Expand Down

0 comments on commit bbb5134

Please sign in to comment.