File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed
Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 66# Enable TLS1.2
77[System.Net.ServicePointManager ]::SecurityProtocol = [System.Net.ServicePointManager ]::SecurityProtocol -bor [System.Net.SecurityProtocolType ]::Tls12
88
9+ # Script Mapping lookup values
10+ $contractCorrelationField = ' displayName'
11+ $contractCorrelationValue = { $_.custom.SDBGroupName }
12+
913# Determine all the sub-permissions that needs to be Granted/Updated/Revoked
1014$currentPermissions = @ {}
1115foreach ($permission in $actionContext.CurrentPermissions ) {
1216 $currentPermissions [$permission.Reference.Id ] = $permission.DisplayName
1317}
1418
15- # region functions
19+ # region functions
1620function Resolve-SDB-IdentityError {
1721 [CmdletBinding ()]
1822 param (
7579 }
7680 }
7781
78- if ($null -ne $correlatedAccount ) {
79- $accountFound = $true
80- } else {
81- $accountFound = $false
82- }
82+ if ($null -eq $correlatedAccount ) {
83+ throw ' NotFound'
84+ }
8385
8486 Write-Information ' Retrieving permissions'
8587 $count = 100
@@ -117,9 +119,8 @@ try {
117119 Write-Information " Contract: $ ( $contract.ExternalId ) . In condition: $ ( $contract.Context.InConditions ) "
118120 if ($contract.Context.InConditions -OR ($actionContext.DryRun -eq $true )) {
119121 # Get group to use objectGuid to avoid name change issues
120- $correlationField = " displayName"
121- # Example: department_<department externalId>
122- $correlationValue = $contract.custom.SDBGroupName
122+ $correlationField = $contractCorrelationField
123+ $correlationValue = $contractCorrelationValue
123124
124125 $group = $null
125126 $group = $groupsGrouped [" $ ( $correlationValue ) " ]
Original file line number Diff line number Diff line change 77# Enable TLS1.2
88[System.Net.ServicePointManager ]::SecurityProtocol = [System.Net.ServicePointManager ]::SecurityProtocol -bor [System.Net.SecurityProtocolType ]::Tls12
99
10+ # Script Mapping lookup values
11+ $resourceCorrelationField = " externalId"
12+ $resourceCorrelationValue = { $ ($resource.ExternalId ) }
13+
1014# region functions
1115function Resolve-SDB-IdentityError {
1216 [CmdletBinding ()]
@@ -133,8 +137,8 @@ try {
133137 # region get group for resource
134138 $actionMessage = " querying group for resource: $ ( $resource | ConvertTo-Json ) "
135139
136- $correlationField = " externalId "
137- $correlationValue = " $ ( $resource .ExternalId ) "
140+ $correlationField = $resourceCorrelationField
141+ $correlationValue = $resourceCorrelationValue
138142
139143 $correlatedResource = $null
140144 $correlatedResource = $groupsGrouped [" $ ( $correlationValue ) " ]
You can’t perform that action at this time.
0 commit comments