Skip to content

Commit

Permalink
Set Inherit Parent Policy to false (#368)
Browse files Browse the repository at this point in the history
Without setting this property to false, this function will not work on objects that have 'InheritParentPolicy' set to true. It sets to false when granting permissions (in Grant RsRestItemAccessPolicy), but does not set to false in this one. In any case, when changing permissions, granting or revoking, the inheritence should be set to false as per the behaviour of the PBIRS app.
  • Loading branch information
8rett authored Mar 2, 2022
1 parent 97a8471 commit 63c3508
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ function Revoke-RsRestItemAccessPolicy
}

$response.Policies = @([PSCustomObject]$response.Policies | WHERE {$_.groupusername -ne $Identity})
$response.InheritParentPolicy=$false

$payloadJson = $response | ConvertTo-Json -Depth 15
Write-Verbose "$payloadJson"
Expand All @@ -132,4 +133,4 @@ function Revoke-RsRestItemAccessPolicy
throw (New-Object System.Exception("Failed to revoke access policies for '$RsItem': $($_.Exception.Message)", $_.Exception))
}
}
}
}

0 comments on commit 63c3508

Please sign in to comment.