From bfd5160bac1fa03271e45344bf7cc635cdc80f6d Mon Sep 17 00:00:00 2001 From: BobJWalker Date: Fri, 17 Dec 2021 09:23:07 -0600 Subject: [PATCH] Handling system wide permissions --- .../api-scripts/enforce-system-team-permissions.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/octopus-samples-instances/api-scripts/enforce-system-team-permissions.ps1 b/octopus-samples-instances/api-scripts/enforce-system-team-permissions.ps1 index 08bfd6b..78f7665 100644 --- a/octopus-samples-instances/api-scripts/enforce-system-team-permissions.ps1 +++ b/octopus-samples-instances/api-scripts/enforce-system-team-permissions.ps1 @@ -112,6 +112,11 @@ $teamScopedUserRoles = Invoke-OctopusApi -OctopusUrl $octopusUrl -endPoint "team $spaceIdList = @() foreach ($userRole in $teamScopedUserRoles.Items) { + if ($null -eq $userRole.SpaceId) + { + continue + } + if ($spaceIdList -notcontains $userRole.SpaceId) { Write-Verbose "Adding the space $($userRole.SpaceId) to the space list"