Skip to content

Commit

Permalink
bugfix: allow disabling review settings for `azuread_access_package_a…
Browse files Browse the repository at this point in the history
…ssignment_policy`
  • Loading branch information
manicminer committed May 30, 2024
1 parent 113a6da commit fdda85d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ func TestAccAccessPackageAssignmentPolicy_update(t *testing.T) {
),
},
data.ImportStep(),
{
Config: r.simple(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.complete(data),
Check: acceptance.ComposeTestCheckFunc(
Expand Down
11 changes: 11 additions & 0 deletions internal/services/identitygovernance/identitygovernance.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ func expandAssignmentReviewSettings(input []interface{}) (*msgraph.AssignmentRev

result.Reviewers = expandUserSets(in["reviewer"].([]interface{}))

if result.AccessReviewTimeoutBehavior == "" &&
(result.DurationInDays == nil || *result.DurationInDays == 0) &&
(result.IsAccessRecommendationEnabled == nil || !*result.IsAccessRecommendationEnabled) &&
(result.IsApprovalJustificationRequired == nil || !*result.IsApprovalJustificationRequired) &&
(result.IsEnabled == nil || !*result.IsEnabled) &&
result.RecurrenceType == "" &&
result.ReviewerType == "" &&
(result.Reviewers == nil || len(*result.Reviewers) == 0) {
return nil, nil
}

return &result, nil
}

Expand Down

0 comments on commit fdda85d

Please sign in to comment.